Azure Load Balancer on Kubernetes IaaS Cluster

2/27/2018

I have been fighting with this for a couple of hours, and I can't work out how to get Kubernetes to configure an Azure Load Balancer when its an IaaS Kubernetes cluster.

This work OOB with AKS, as you'd expect.

Obviously, I am missing where I can input the Service Principal to allow k8s to be able to configure resources in Azure.

-- Brendan Thompson
azure
kubernetes

1 Answer

2/27/2018

The official recommended way is ACS-Engine. Describing it is a bit too much for an answer, but when you define your cluster you are supposed to provide Azure credentials to it:

{
  "apiVersion": "vlabs",
  "properties": {
    "orchestratorProfile": {
      "orchestratorType": "Kubernetes"
    },
    "masterProfile": {
      "count": 1,
      "dnsPrefix": "",
      "vmSize": "Standard_D2_v2"
    },
    "agentPoolProfiles": [
      {
        "name": "agentpool1",
        "count": 3,
        "vmSize": "Standard_D2_v2",
        "availabilityProfile": "AvailabilitySet"
      }
    ],
    "linuxProfile": {
      "adminUsername": "azureuser",
      "ssh": {
        "publicKeys": [
          {
            "keyData": ""
          }
        ]
      }
    },
    "servicePrincipalProfile": {
      "clientId": "CLIENT_ID_GOES_HERE",
      "secret": "CLIENT_SECRET_GOES_HERE"
    }
  }
}

After you provision a cluster with proper input it will work out of the box. Walkthrough

-- 4c74356b41
Source: StackOverflow