acs-engine icon indicating copy to clipboard operation
acs-engine copied to clipboard

Unable to create loadbalancer service in custom vnet acs kubernetes

Open rrajadevops opened this issue 8 years ago • 1 comments

Hi Team,

I created acs cluster with custom VNET, I can access my cluster without any issue. When i try to create loadbalancer based service i am getting the below error.

Events: Type Reason Age From Message


Normal EnsuringLoadBalancer 1s (x6 over 2m) service-controller Ensuring load balancer Warning CreatingLoadBalancerFailed 1s (x6 over 2m) service-controller Error creating load balancer (will retry): Failed to ensure load balancer for service ge-dashboard-test/pythonservice: azure.BearerAuthorizer#WithAuthorization: Failed to refresh the Token for request to https://management.azure.com/subscriptions/e9b70815-40be-4610-b24c-***/resourceGroups/ge--test/providers/Microsoft.Network/loadBalancers/ge-dashboard-test-internal?api-version=2017-03-01: StatusCode=0 -- Original Error: adal: Refresh request failed. Status Code = '400'

I tried with static IP also but it is keep on showing status as pending, PFB for more information

My YAML file:

apiVersion: v1 kind: Service metadata: name: pythonservice namespace: ge-dashboard-test labels: app: python spec: loadBalancerIP: 13.93.177.74 ports:

  • port: 80 name: http targetPort: 5000 type: LoadBalancer selector: app: python

D:\k8s\dashboard>kubectl get svc -n ge-dashboard-test NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE pythonservice LoadBalancer 10.0.168.66 80:31663/TCP 11m

D:\k8s\dashboard>kubectl describe svc pythonservice -n ge-dashboard-test Name: pythonservice Namespace: ge-dashboard-test Labels: app=python Annotations: Selector: app=python Type: LoadBalancer IP: 10.0.168.66 IP: 13.93.177.74 Port: http 80/TCP TargetPort: 5000/TCP NodePort: http 31663/TCP Endpoints: 11.0.0.14:5000 Session Affinity: None External Traffic Policy: Cluster Events:

Kindly suggest how to create ladbalancer based service for custom VNET acs cluster.

Regards, Raja

rrajadevops avatar Apr 03 '18 17:04 rrajadevops

This is related to service principal issue, i just created new service principal with Azure cli and used that AppID and PASSWD in kubernetes.json

az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/e915-4**e-4610-b24c-c***"

rrajadevops avatar Apr 04 '18 09:04 rrajadevops