0
votes

I'm following the tutorial to run a containerized application on Azure AKS on https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-deploy-application but my deployment failes to create a load balancer for my service:

Normal   EnsuringLoadBalancer        3m (x12 over 33m)  service-controller  
Ensuring load balancer
Warning  CreatingLoadBalancerFailed  3m (x12 over 33m)  service-controller  
Error creating load balancer (will retry): Failed to ensure load balancer f 
for service default/azure-vote-front: azure.BearerAuthorize
#WithAuthorization: Failed to refresh the Token for request to

https://management.azure.com/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxxxx/
resourceGroups/xxxxxxxxxxxxxxxxxxxxxxxxxxxx/providers/Microsoft.Network/load
Balancers/kubernetes-internal?api-version=2017-03-01: StatusCode=0 -- 
Original Error: adal: Refresh request failed. Status Code = '401'

When running kubectl get service myservice --watch the external ip just stays in status pending. What could be the cause of this?

1

1 Answers

2
votes

You created the AKS cluster with the service principal that lacks permissions to create\manage resources for the cluster. you need to recreate the cluster with the proper service principal (much easier than fixing).