【发布时间】:2021-03-30 19:57:53
【问题描述】:
我有一个 go 程序需要访问配置映射,当使用以下 clusterRole 时出现错误禁止
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: s-access
labels:
app.kubernetes.io/instance: te-mger
rules:
- verbs:
- get
- watch
- list
- update
apiGroups:
- dpt.com
resources:
- pods
现在,当我将其更改为以下内容时,它可以工作,(将 apiGroups '')和 configmaps 添加到 resources
由于这是一种解决方法,我们应该为长解决方案做些什么
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: s-access
labels:
app.kubernetes.io/instance: te-mger
rules:
- verbs:
- get
- watch
- list
- update
apiGroups:
- dpt.com
- ''
resources:
- pods
- configmaps
我阅读了以下内容,但没有帮助https://kubernetes.io/docs/reference/access-authn-authz/rbac/
我想避免使用 apiGroups: ''
【问题讨论】:
-
我想避免使用 apiGroups: '' 你不能!
标签: azure kubernetes azure-aks