azure - 无法使用 Rest API 将 Windows 节点拉取添加到集群

标签 azure azure-rest-api

我想将 Windows Server 容器添加到 Azure kubernetes 集群。目前,使用 Azure Rest API 来管理集群。但它显示以下错误:

{
  "code": "AzureCNIOnlyForWindows",
  "message": "Windows agent pools can only be added to AKS clusters using Azure-CNI."
}

{
  "location": "location1",
  "tags": {
    "tier": "production",
    "archv2": ""
  },
  "properties": {
    "kubernetesVersion": "",
    "dnsPrefix": "dnsprefix1",
    "agentPoolProfiles": [
      {
        "name": "nodepool1",
        "count": 3,
        "vmSize": "Standard_DS1_v2",
        "osType": "Linux"
      }
    ],
    "linuxProfile": {
      "adminUsername": "*******",
      "ssh": {
        "publicKeys": [
          {
            "keyData": "keydata"
          }
        ]
      }
    },
    "networkProfile": {
      "loadBalancerSku": "basic"
    },
    "windowsProfile": {
      "adminUsername": "********",
      "adminPassword": "************************"
    },
    "servicePrincipalProfile": {
      "clientId": "clientid",
      "secret": "secret"
    },
    "addonProfiles": {},
    "enableRBAC": true,
    "enablePodSecurityPolicy": true
  }
}

{
  "code": "AzureCNIOnlyForWindows",
  "message": "Windows agent pools can only be added to AKS clusters using Azure-CNI."
}

最佳答案

根据您的问题,我假设您想要将 Windows 节点池添加到 AKS 群集。然后,该错误意味着您没有为 AKS 群集使用 Azure-CNI 网络类型。对于 Windows 节点池,请参见以下内容:

In order to run an AKS cluster that supports node pools for Windows Server containers, your cluster needs to use a network policy that uses Azure CNI (advanced) network plugin.

因此,您的解决方案是创建一个具有 Azure-CNI 网络类型的新 AKS 群集。然后再次添加Windows节点池。看看 Create AKS cluster for Windows node pool through Azure CLI 的步骤。在 REST API 中,您需要在 properties.networkProfile 中设置 networkPlugin 值为 azure。请参阅NetworkPlugin .

关于azure - 无法使用 Rest API 将 Windows 节点拉取添加到集群,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57056477/

相关文章:

用于运行构建或管道的 Azure REST API

c# - 未在 Azure 包中创建 Web.config

azure - 加速 Azure Devops Pipeline 中的 Azure Cosmos DB 模拟器任务组

azure - 使用 REST API 创建 Azure App Insights 失败需要 ROLE

azure - 我可以使用 azure vm Rest api (PUT) 更改现有虚拟机中的操作系统配置文件吗?

azure-devops - 在 Azure DevOps REST API 中查找附件以进行删除

azure - 在 Office 365 中更改域名如何影响 Azure Active Directory 连接计算机的用户身份验证?

Azure DevOps Wiki 页面 - 权限 - 创建 Wiki

azure - 仅在 azure 的仪表板中显示值?

c# - 使用 C# 在 Azure 中创建资源组