Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Problem

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

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


Cause

Cluster role binding to services is not performed


Fix

Use below command which creates the cluster role and binds all services

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