azure-aks - 错误:为处于 CREATED 状态的 pod 分配身份失败 - AKS AAD-Pod 身份
问题描述
对于使用托管标识 AAD-POD 标识的 aks (1.14.8) 的 NMI 日志中的 pod,我收到以下错误。我已按照https://github.com/Azure/aad-pod-identity中指定的步骤进行操作,但我们希望将托管标识用于 azure sql paas。参考链接:https ://trstringer.com/connect-k8s-apps-msi/
E0618 17:19:40.762387 1 server.go:370] failed to get matching identities for pod: default/schedulerserviceapi-7fc4dc9547-95vbw, error: getting assigned identities for pod default/schedulerserviceapi-7fc4dc9547-95vbw in CREATED state failed after 16 attempts, retry duration [5]s. Error: <nil>
解决方案
造成这种情况的可能原因是您的集群服务主体没有该角色Managed Identity Operator
。
您可以检查mic
服务的日志,并查找以下日志片段“无权执行操作 Microsoft.ManagedIdentity/userAssignedIdentities/assign/action'”
您可以使用以下 CLI 命令将角色分配给服务主体:
# retrieve cluster service principal clientId ($SP_CLIENT_ID below)
az aks show -g $RESOURCE_GROUP -n $AKS_CLUSTER_NAME --query servicePrincipalProfile.clientId -o tsv
# assign role to SP
az role assignment create --role "Managed Identity Operator" --assignee $SP_CLIENT_ID --scope /subscriptions/$SUBSCRIPTION_ID/resourcegroups/$RESOURCE_GROUP
推荐阅读
- groovy - 如何使用 Groovy 将节点附加到 xml 的开头
- python - 使用列名作为列表在 Dataframe 的列中迭代,然后在 Python 中循环遍历列表
- dynamic - 使用两个不同的 SSL 端口配置 IIS 的两个 dydns 网站并为两者配置端口转发
- c++ - C++ typedef 具有不定大小的元组
- wpf - 如何在 WPF 中的 DataTemplate 中查找 TextBox 的值?
- java - 使用 csv 进行哈希图和数组计算的正确方法。数据文件
- java - 用于自定义对象的 Android 房间类型转换器
- css - 如何在其旁边的 span 元素底部设置 span 元素并使用 css 省略并做出反应?
- django - 过滤值范围内的对象,如 id - Django
- windows - 在安装期间增加 Windows 事件日志大小