what does Unknown user “client” mean?

前端 未结 4 1480
梦如初夏
梦如初夏 2020-12-02 00:30

When I run a simple command on my local shell with gcloud sdk.

$ kubectl get pod

I get such error:

Error from server

4条回答
  •  情话喂你
    2020-12-02 01:01

    This happens when you disable Legacy Authorisation in the cluster settings, because the client certificate that you are using is a legacy authentication method. So it looks like what is happening is the client authentication succeeds but the authorisation fails, as expected. ("Unknown user" in the error message, confusingly, seems to mean the user is unknown to the authorisation system, not to the authentication system.)

    You can either disable the use of the client certificate with

    gcloud config unset container/use_client_certificate
    

    and then regenerate your kubectl config with

    gcloud container clusters get-credentials my-cluster
    

    Or you can simply re-enable Legacy Authorisation in the cluster settings in the Google Cloud Console, or using the command:

    gcloud container clusters update [CLUSTER_NAME] --enable-legacy-authorization
    

提交回复
热议问题