AKs cluster on azure .Voting app application unable to access

Hello Team,

I basically followed the lab to create AKS cluster on azure . kodekloudhub/example-voting-app-kubernetes (github.com)
i don’t see a public Ip assigned so that i can access the voting and result app on the browser ??? What am i missing here ?

PS /home/system> kubectl get deployments,svc
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/postgres-deploy 1/1 1 1 8h
deployment.apps/redis-deploy 1/1 1 1 8h
deployment.apps/result-app-deploy 1/1 1 1 8h
deployment.apps/voting-app-deploy 1/1 1 1 8h
deployment.apps/worker-app-deploy 1/1 1 1 8h

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/db ClusterIP 10.0.218.208 5432/TCP 8h
service/kubernetes ClusterIP 10.0.0.1 443/TCP 17h
service/redis ClusterIP 10.0.12.29 6379/TCP 8h
service/result-service NodePort 10.0.92.109 80:30005/TCP 8h
service/voting-service NodePort 10.0.28.179 80:30004/TCP 8h

I assume you are using our Azure playground, and have created a local credential with az login and az aks get-credentials. The trick here is that you do not have access to the nodes, so a nodeport service won’t work for you. But I got this to work, sort of, by doing the following:

  • kubectl port-forward svc/voting-service 30004:80 &
  • Now you can browse on your browser as localhost:30004

I actually could have used any port; I use 30004 since that’s what the nodeport assignment would have been.