I’ve a go program which need to access to config map, when using the following clusterRole we got error forbidden
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
Now when I change it to the following it works, (adding apiGroups '') and configmaps to the resources
As this is a workaround what should we do for long solutions
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
I read the following but it didnt help https://kubernetes.io/docs/reference/access-authn-authz/rbac/
I want to avoid using apiGroups: ''