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

How to create a Windows node pool in AKS cluster?

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

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

关于这种情况似乎有一个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