如何在启用了Calico的情况下安装AKS

时间:2019-01-30 10:33:22

标签: azure arm-template azure-kubernetes azure-aks azure-template

This definition明确提到您可以将networkPolicy属性用作networkProfile的一部分并将其设置为Calico,但这是行不通的。所有节点都处于Not Ready状态的AKS创建只是超时。

1 个答案:

答案 0 :(得分:0)

您需要启用基础提供商功能:

az feature list --query "[?contains(name, 'Container')].{name:name, type:type}" # example to list all features
az feature register --name EnableNetworkPolicy --namespace Microsoft.ContainerService
az provider register -n Microsoft.ContainerService

之后,您可以仅使用REST API \ ARM模板来创建AKS:

{
  "location": "location1",
  "tags": {
    "tier": "production",
    "archv2": ""
  },
  "properties": {
    "kubernetesVersion": "1.12.4", // has to be 1.12.x, 1.11.x doesnt support calico AFAIK
    "dnsPrefix": "dnsprefix1",
    "agentPoolProfiles": [
      {
        "name": "nodepool1",
        "count": 3,
        "vmSize": "Standard_DS1_v2",
        "osType": "Linux"
      }
    ],
    "linuxProfile": {
      "adminUsername": "azureuser",
      "ssh": {
        "publicKeys": [
          {
            "keyData": "keydata"
          }
        ]
      }
    },
    "servicePrincipalProfile": {
      "clientId": "clientid",
      "secret": "secret"
    },
    "addonProfiles": {},
    "enableRBAC": false,
    "networkProfile": {
        "networkPlugin": "azure",
        "networkPolicy": "calico", // set policy here
        "serviceCidr": "xxx",
        "dnsServiceIP": "yyy",
        "dockerBridgeCidr": "zzz"
    }
  }
}

ps。 不幸的是,在撰写本文时,头盔似乎并不起作用(我怀疑这是因为头盔所依赖的kubectl port-forward也不起作用)。