Unable to create loadbalancer service in custom vnet acs kubernetes
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
D:\k8s\dashboard>kubectl describe svc pythonservice -n ge-dashboard-test
Name: pythonservice
Namespace: ge-dashboard-test
Labels: app=python
Annotations:
Kindly suggest how to create ladbalancer based service for custom VNET acs cluster.
Regards, Raja
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***"