I have a service that lives inside my AKS cluster that requires both internal and external communication to authenticate against.
The current flow is this
GUI Application communicates to to ingress by FQDN, traffic gets handed off to Middleware, Middleware talks to another Middleware within the same Namespace and authenticates.
After the first set of authentication is performed, the GUI application then needs to communicate with the second middleware.
To accomplish this, I thought I would set up an external IP on the service so I can communicate with the pods within the namespace, but I am unable to resolve this externally. Within the Cluster, I can telnet and hit the Pod / IP just fine which tells me this is a network issue, I am just unsure as to where.
These are the steps I have performed so far:
# creating IP from prefix
az network public-ip create \
--name mw-dev-ip \
--resource-group AKS-Dev-Node \
--allocation-method Static \
--sku Basic \
--version IPv4
# Get IP address
az network public-ip show \
-n mw-dev-ip \
-g AKS-Dev-Node \
--query "ipAddress" \
-o tsv
# Enter your details below.
PIP_RESOURCE_GROUP=AKS-Dev-Node
AKS_RESOURCE_GROUP=AKS-Dev
AKS_CLUSTER_NAME=AKS-Dev-Cluster
#
CLIENT_ID=$(az aks show --resource-group $AKS_RESOURCE_GROUP --name $AKS_CLUSTER_NAME --query "servicePrincipalProfile.clientId" --output tsv)
SUB_ID=$(az account show --query "id" --output tsv)
az role assignment create \
--assignee $CLIENT_ID \
--role "Network Contributor" \
--scope /subscriptions/$SUB_ID/resourceGroups/$PIP_RESOURCE_GROUP
Doing these steps above created the Load balancer with a public IP address that I was then able to add to my Service manifest as such
apiVersion: v1
kind: Service
metadata:
annotations:
service.beta.kubernetes.io/azure-load-balancer-resource-group: AKS-Dev-Node
name: {{ template "mw.fullname" . }}
labels:
app: {{ template "mw.name" . }}
chart: {{ template "mw.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
loadBalancerIP: {{ .Values.mw_host }}
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: {{ .Values.service.port }}
protocol: TCP
name: {{ .Values.service.name }}
- port: {{ .Values.ping.port }}
targetPort: {{ .Values.ping.port }}
protocol: TCP
name: {{ .Values.ping.name }}
selector:
app: {{ template "mw.name" . }}
release: {{ .Release.Name }}
I am unsure what step I am missing though to hit this from the outside. I checked my NSG and all traffic is open, same for the firewall in front of it. Within the cluster I can telnet and hit it just fine as well as if I port forward the pod endpoint directly.
I can also telnet against the Endpoint IP of the pod(s) without issue as well, its just trying to route this external ip to the endpoints to hit the service from the outside.
Any helpful suggestions would be greatly appreciated.