Asking for help? Comment out what you need so we can get more information to help you!
facing the following issue
@controleplanenode:/usr/local/k8s_manifests/authentication/certs/rbac$ kubectl get po --context=sree-context
Error from server (Forbidden): pods is forbidden: User "sree " cannot list resource “pods” in API group “” in the namespace “default”
role and role binding files
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: pod-read-access
namespace: default
rules:
- apiGroups: [“”] # “” indicates the core API group
resources: [“pods”]
verbs: [“get”, “watch”, “list”]
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: pod-ro-binding
namespace: default
subjects:
- kind: User
name: sree
namespace: default
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: pod-read-access
apiGroup: rbac.authorization.k8s.io