azure - 无法使用 Rest API 将 Windows 节点拉入集群
问题描述
我想将 Windows Server 容器添加到 Azure kubernetes Cluster.Currenty,使用 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 节点池,请参见下文:
为了运行支持 Windows Server 容器的节点池的 AKS 群集,你的群集需要使用使用 Azure CNI(高级)网络插件的网络策略。
因此,您的解决方案是使用 Azure-CNI 网络类型创建一个新的 AKS 群集。然后再次添加 Windows 节点池。查看通过 Azure CLI 为 Windows 节点池创建 AKS 群集的步骤。而在 REST API 中,您需要networkPlugin
在properties.networkProfile
with value中设置azure
。请参阅网络插件。
推荐阅读
- ios - 可以对 iPad OS 做出反应吗?
- regex - 如何在没有变量冲突的情况下打印正则表达式默认变量 $1
- c# - 为一段时间创建一个类/方法(启动、重置、停止、获取 istant、获取 timerun)
- haskell - 尝试使用 newtype 将现有数据类型作为我自己的
- swift - 如何安装 j2objc
- c++ - 一种安全的、符合标准的方法来使类模板特化仅在实例化时才使用“static_assert”编译失败?
- android - AppWidget布局内ImageView中的图像缩放和定位
- ios - 如何更新应用内购买的 UI?
- javascript - 自动完成 Jquery 无法在主机上运行,但在 localhost 上运行良好
- python - 班级员工打印方法