AKS icon indicating copy to clipboard operation
AKS copied to clipboard

AKS Load Balancer service is not assigned an external IP

Open dbafromthecold opened this issue 7 years ago • 1 comments

Noticed today that when creating a deployment and service in AKS that the service does not get assigned an external IP address (it remains pending).

The yaml file I'm using to deploy is: -

apiVersion: apps/v1beta1 kind: Deployment metadata: name: sqlserver labels: app: sqlserver spec: replicas: 1 template: metadata: labels: name: sqlserver spec: containers: - name: sqlserver1 image: microsoft/mssql-server-linux:latest ports: - containerPort: 1433 env: - name: SA_PASSWORD value: "Testing1122" - name: ACCEPT_EULA value: "Y"

apiVersion: v1 kind: Service metadata: name: sqlserver-service spec: ports: name: sqlserver port: 1433 targetPort: 1433 selector: name: sqlserver type: LoadBalancer

This has previously worked with no issue up until now.

When running

kubectl describe sqlserver-service

I can see the following error: -

Error creating load balancer (will retry): failed to ensure load balancer for service default/sqlserver-service: azure.BearerAuthorizer#WithAuthorization: Failed to refresh the Token for request to https://management.azure.com/subscriptions/SUB_ID/resourceGroups/MC_containers1_SQLK8sCluster1_eastus/providers/Microsoft.Network/loadBalancers?api-version=2017-09-01: StatusCode=0 -- Original Error: adal: Refresh request failed. Status Code = '401'. Response body: {"error":"invalid_client","error_description":"AADSTS70002: Error validating credentials. AADSTS50012: Invalid client secret is provided.\r\nTrace ID: 17d1f0ce-6c11-4f8e-895d-29194d973900\r\nCorrelation ID: 3e11d85c-77bf-4041-a41d-267bfd5f066c\r\nTimestamp: 2019-01-23 18:58:59Z","error_codes":[70002,50012],"timestamp":"2019-01-23 18:58:59Z","trace_id":"17d1f0ce-6c11-4f8e-895d-29194d973900","correlation_id":"3e11d85c-77bf-4041-a41d-267bfd5f066c"}

I'm guessing that it's an authentication issue but I'm unsure of how to resolve

dbafromthecold avatar Jan 23 '19 19:01 dbafromthecold

Got this fixed with the help of MS support. Blogged about the fix here: - https://dbafromthecold.com/2019/01/30/azure-kubernetes-service-error-loadbalancer-type-service-external-ip-stays-pending/

dbafromthecold avatar Feb 17 '19 22:02 dbafromthecold