Error from server (Forbidden): pods is forbidden: User "oidc:testuser" cannot list resource "pods" in API group "" in the namespace "default"
TKGI environments, this may happen on any version.
This error is reported if the LDAP group configured in the ClusterRoleBinding configured to bind the LDAP user group to the ClusterRole doesn't reference the group name starting with oidc. For example, for group named tkgiAdmins:
Incorrect:
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: tkgiAdmins
Correct:
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: oidc:tkgiAdmins
Ensure the ClusterRoleBinding for the LDAP group references oidc:groupname, for example:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: ldap-admin-clusterrolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: ldap-admin-clusterrole
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: oidc:tkgiAdmins