k8s.Autorest.HttpOperationException: Operation returned an invalid status code 'Forbidden' #891
-
Hi folks, I have a container hosted as pod inside a cluster. I am trying to get cluster config like this. But getting exception Am I doing it incorrectly or is this some bug? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Please note: I am using token login from web UI for cluster dashboard |
Beta Was this translation helpful? Give feedback.
-
Chances are that the default service account for your pod doesn't have the right RBAC permissions.
You can read more details about service accounts here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ |
Beta Was this translation helpful? Give feedback.
-
To add, you can debug the permission with |
Beta Was this translation helpful? Give feedback.
-
In addition to changing the This was for an AWS EKS cluster |
Beta Was this translation helpful? Give feedback.
-
Running into a similar issue but specifically with Ingress objects. We have included the automountServiceAccountToken: true and also verified that kubectl auth can-i returns the expected "yes". The only other resource we've found appears to be empty. |
Beta Was this translation helpful? Give feedback.
Chances are that the default service account for your pod doesn't have the right RBAC permissions.
InClusterConfig()
uses the default pod service accountYou can read more details about service accounts here:
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/