gpt4 book ai didi

Azure AKS 用户凭据登录 K8 仪表板和 RBAC 内置角色

转载 作者:行者123 更新时间:2023-12-02 08:30:56 28 4
gpt4 key购买 nike

根据documentation , Azure Kubernetes 服务群集用户角色仅允许访问 Microsoft.ContainerService/managedClusters/listClusterUserCredential/action API 调用。

我的用户属于 AD 组,该组具有 Azure Kubernetes Service Cluster User Role AKS 群集上的权限以及所有群集角色和群集角色绑定(bind)已通过 kubectl 应用。 。

我可以仔细检查并验证对仪表板和权限的访问是否适用于以下步骤:

 1. az login
2. az aks get-credentials --resource-group rg --name aks
3. kubectl proxy
4. Open web connection
5. Get prompt on terminal to login via device code flow
6. Return to web connection on dashboard
7. I can correctly verify that my permissions apply,
i.e. deleting a job does not work and this falls in line with my
kubectl clusterrole bindings to the Azure AD group.

但是当我尝试使用az aks browse时像这样自动打开浏览器的命令,即没有 kubectl proxy :

 1. az login
2. az aks get-credentials --resource-group rg --name aks
3. az aks browse --resource-grouprg --name aks

我不断收到以下错误:

The client 'xxx' with object id 'yyyy' does not have authorization to perform action 
'Microsoft.ContainerService/managedClusters/read' over scope
'/subscriptions/qqq/resourceGroups/rg/providers/Microsoft.ContainerService/managedClusters/aks'
or the scope is invalid. If access was recently granted, please refresh your credentials.

一个dirty解决方案是申请 Reader该 AD 组的 AKS 群集上的角色 - 那么此问题就会消失,但为什么 az aks browse 会消失?需要Microsoft.ContainerService/managedClusters/read许可以及为什么不包含在 Azure Kubernetes Service Cluster User Role 中?

这里发生了什么?

最佳答案

目前,该命令

az aks browser --resource-grouprg --name aks 不适用于最新版本的 AKS,您可以在此处找到完整的详细信息。

https://github.com/MicrosoftDocs/azure-docs/issues/23789

此外,您当前的问题还可能是您的用户 XXX 在订阅/资源组级别没有正确的 IAM 访问级别。

关于Azure AKS 用户凭据登录 K8 仪表板和 RBAC 内置角色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61100807/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com