使用Azure CLI添加AKS节点池时--aks-custom-headers参数报错
问题解决:添加AKS Windows节点池时参数错误
错误原因分析
- 命令中
--aks-custom-headers参数的取值末尾多了一个逗号,导致Azure CLI无法正确解析该参数 - 使用的Kubernetes 1.20.5版本过旧,对应Azure CLI版本大概率不支持
WindowsContainerRuntime=containerd这个自定义头配置
解决步骤
- 修正参数格式:删除
WindowsContainerRuntime=containerd后面的多余逗号,确保参数格式合法 - 升级Azure CLI到最新版本:旧版本CLI未适配Windows节点池使用containerd的配置参数,执行命令完成升级:
az upgrade - (可选)升级Kubernetes版本:Kubernetes 1.20.x已不在官方支持范围内,建议将集群和节点池版本升级到1.23及以上,获得更稳定的兼容性与技术支持
修正后的完整命令示例
az aks nodepool add --resource-group resource-group-name --cluster-name [cluster] --os-type Windows --name nodepool --node-vm-size Standard_D4s_v3 --kubernetes-version 1.23.12 --aks-custom-headers WindowsContainerRuntime=containerd --node-count 1
内容的提问来源于stack exchange,提问作者Anandaraj
相关产品推荐
相关产品推荐

