如何在 AKS 群集中创建 Windows 节点池?

时间:2021-02-05 16:31:04

标签: azure kubernetes azure-aks

我正在尝试添加一个可以运行基于 Windows 的容器的节点池。我在 Azure 门户中看到的是一个禁用选项,用于选择 Windows 作为操作系统。提示说:Windows node pools require a Windows authentication profile。我尝试在谷歌上搜索可能的解决方案,但一无所获。

如何向现有 AKS 群集提供 Windows 身份验证配置文件,以使 AKS 运行基于 Windows 的容器?

enter image description here

1 个答案:

答案 0 :(得分:3)

似乎有关于这种情况的 open issue

问题是在第一次创建集群时,您没有提供任何 --windows-admin-password--windows-admin-username。因此,当您尝试创建将创建 VM 的新 Windows 节点池时,VM 没有任何 Windows authentication profile

如果您查看集群资源 az aks show 并没有看到 Window 配置文件,那么您必须创建一个新集群,例如使用 AZ CLI

az aks create -g MyResourceGroup -n MyManagedCluster --load-balancer-sku Standard --network-plugin azure --windows-admin-username azure --windows-admin-password 'replacePassword1234$'

如果您使用 terraform 创建集群,则可以添加此部分:

# Create AKS Cluster
resource "azurerm_kubernetes_cluster" "akscluster" {

# Code goes here..

  windows_profile {
    admin_username    = "azure"
    admin_password    = "azure"
  }
}

也要注意这个thread