我创建了一个ARM模板来部署Azure Kubernetes服务实例,我试图将其插入VSTS中的CI / CD管道 . 在第一次部署时,一切都按预期工作,并且K8s群集已成功创建 . 但是,在重新部署时,模板未通过验证阶段,并出现以下错误:
{
"message": "The template deployment 'Microsoft.Template' is not valid according to the validation procedure."
"details": [
{
"code":"PropertyChangeNotAllowed",
"message":"Provisioning of resource(s) for container service <cluster name> in resource group <resource group name> failed. Message:"
{
"code": "PropertyChangeNotAllowed",
"message": "Changing property 'linuxProfile.ssh.publicKeys.keyData' is not allowed.",
"target": "linuxProfile.ssh.publicKeys.keyData"
}
}
]
}
因此,模板显然不是幂等的,它完全破坏了ARM模板部署的预期性质 .
有没有人设法为此找到解决方法?
1 回答
解决方法是将SSH RSA公钥指定为模板参数,并在配置Linux配置文件时使用它 . 我在下面发布了我的ARM模板: