Unable to list Kube related resources

Unable to list Kube related resources

Problem

Unable to list Kube related resources (pods,jobs,services,etc).

Error: User "system:serviceaccount:default:default" cannot list pods in the namespace "default"


Cause

Cluster role binding to services has not been performed.


Fix

Use the command given below to create the cluster role and bind all services together.

#kubectl create clusterrolebinding serviceaccounts-cluster-admin --clusterrole=cluster-admin --group=system:serviceaccounts

Related content