我刚刚在Azure上从一个订阅迁移到另一个订阅。虽然subscriptionId相同,但tenantId已更改。
迁移后,我的AKS集群不再能够从ACR拉取镜像。我的AKS目前使用的服务原则在迁移后不再有效。我已经更新了服务原则,但我仍然无法拉取镜像。
有没有其他我需要注意的配置?
发布于 2021-09-18 00:12:41
请验证"AcrPull“角色是否仍分配给AKS节点池的托管身份(Kubelet)。
Terrafrom示例:
resource "azurerm_role_assignment" "example" {
scope = azurerm_container_registry.acr.id
role_definition_name = "AcrPull"
principal_id = azurerm_kubernetes_cluster.aks.kubelet_identity[0].object_id
}AZ cli示例:
export KUBE_ID=$(az aks show -g <resource group> -n <aks cluster name> --query identityProfile.kubeletidentity.objectId -o tsv)
export ACR_ID=$(az acr show -g <resource group> -n <acr name> --query id -o tsv)
az role assignment create --assignee $KUBE_ID --role "AcrPull" --scope $ACR_IDhttps://stackoverflow.com/questions/69229943
复制相似问题