Search code examples
kuberneteskubectlazure-akskubeconfig

Error from server (Forbidden): pods is forbidden: User cannot list resource "pods" in API group at the cluster scope


My private AKS Cluster is accessible only to the root user using kubectl on a jumphost. But for a non-root user it throws below error message:

someuser@jump-vm$ kubectl get pods -A
Error from server (Forbidden): pods is forbidden: User "XX-XX-XX-XX-XX" cannot list resource "XX" in API group " " at the cluster scope

How to resolve this error?


Solution

  • in this case solution was to delete the old config from $HOME/.kube/ and re-initialize it after az login with the user in question