Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Unable to access logs or exec into pods of GKE

I am running Cassandra cluster on a GKE version 1.22.17-gke.4000. It was all working fine though the APIs are deprecated, just yesterday when i tried to check the logs of a pod, I encountered the following issue:

Error from server (InternalError): Internal error occurred: Authorization error (user=kube-apiserver, verb=get, resource=nodes, subresource=proxy)

Eventually, I realized that this is happening for exec command as well. Not sure what changed suddenly that I am facing this issue. 

Please help.

0 1 612
1 REPLY 1

Hello chetanrathoretl,

Welcome to GCC!

The kube-apiserver failed to access the kubelet and RBAC rules might be corrupted.

You need to grant the user kube-apiserver to the resource node that kubelet provides by creating ClusterRole and ClusterRoleBinding.

Here  are some examples of RBAC API Obects that can serve as your reference in using ClusterRole and ClusterRoleBinding. 

Additional info:
Best practices for GKE RBAC
Authorize actions in clusters using RBAC

Top Labels in this Space
Top Solution Authors