Not able to access app deployed on kubernetes cluster

9/10/2018

I am getting following error while accessing the app deployed on Azure kubernetes service

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "forbidden: User \"system:anonymous\" cannot get path \"/\"",
  "reason": "Forbidden",
  "details": {},
  "code": 403
}

I have followed all steps as given here https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-prepare-app

I know that this is something to do with authentication and RBAC, but i don't know what exactly is wrong and where should i make changes.

-- Preetam
azure-aks
azure-container-registry
kubernetes

1 Answer

9/12/2018

Just follow the steps in the link you posted. You will be successful in finishing that. The destination of each step below:

  1. Create the image and make sure it can work without any error.
  2. Create an Azure Container Registry and push the image into the registry.
  3. Create a Service Principal for the AKS to let it just can pull the image from the registry.
  4. Change the yaml file and make it pull the image from the Azure Registry, then crate pods in the AKS nodes.

You just need these four steps to run the application on AKS. Then get the IP address through the command kubectl get service azure-vote-front --watch like the step 4. If you can not access the application, check your steps carefully again.

Also, you can check all the pods status through the command kubectl describe pods or one pod with kubectl describe pod podName.

Update

I test with the image you provide and the result here:

enter image description here

And you can get the service information and know which port you should use to browse.

enter image description here

-- Charles Xu
Source: StackOverflow