我想将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."
}
答案 0 :(得分:0)
根据您的问题,我假设您要将Windows节点池添加到AKS群集。然后,该错误表示您未对AKS群集使用Azure-CNI网络类型。对于Windows节点池,请参见下文:
为了运行支持Windows节点池的AKS群集 服务器容器,您的群集需要使用一个网络策略 使用Azure CNI(高级)网络插件。
因此,您的解决方案是使用Azure-CNI网络类型创建一个新的AKS群集。然后再次添加Windows节点池。看一下Create AKS cluster for Windows node pool through Azure CLI的步骤。在REST API中,您需要将networkPlugin
中的properties.networkProfile
设置为值azure
。参见NetworkPlugin。