Kubernetes fails to create loadbalancer on azure

2/28/2019

We have created the kubernetes cluster on the azure VM, with Kube master and two nodes. We have deployed application and created the service with "NodePort" which works well. But when we try to use the type: LoadBalancer then it create service but the external IP goes pending state. Currently we unable create service type load balance and due this "ingress" nginx controller also going to same state. So we are not sure how do we setup load balancing in this case.

We have tried creating Load Balancer in Azure and trying to use that ip like shown below in service.

kind: Service
apiVersion: v1
metadata:
  name: jira-service
  labels:
    app: jira-software
  annotations:
    service.beta.kubernetes.io/azure-load-balancer-internal: "true"
spec:
  selector:
    app: jira-software
  type: LoadBalancer
  loadBalancerIP: xxx.xxx.xxx.xxx
  ports:
  - name: jira-http
    port: 8080
    targetPort: jira-http

similarly we have one more application running on this kube cluster and we want to access application based on the context path. if we invoke jira it should call backend server jira http://dns-name/jira if we invoke some other app like bitbucket http://dns-name/bitbukcet

-- Devendrappa Kori US - ADVS
azure
kubernetes

1 Answer

2/28/2019

If I understand correctly you used type LoadBalancer in Virtual Machine, which will not work - type LoadBalancer works only in managed Kubernetes services like GKE, AKS etc.

You can find more information here.

-- aurelius
Source: StackOverflow