Wednesday, November 27, 2019

Error: You must be logged in to the server (Unauthorized)


   When users try to list pod of OKE (oracle kubernete engine) via kubectl get po. It error out as below
error: You must be logged in to the server (Unauthorized)


  It is quite possible the users don't have correct privilege in  Oracle OCI IAM.  Users need to be in a group which has a policy "USE"  or higher "MANAGE"  for OKE clusters.

ie  Allow group <group-name> to use  cluster-family in <location>

1 comment:

Glaudiston said...

This can happen too if you have multiple profiles in your ~/.oci/config file.
You can solve it by replacing de [DEFAULT] profile with the one you want, or editing your .kube/config and adding
- --profile
- profilename
in `args:` section