After switching gcloud projects using ...
gcloud init
... and then try to execute some kubectl command, for example, for example:
kubectl get rc
... I get this error:
error: couldn't read version from server: Get https://130.211.59.254/api: x509: certificate signed by unknown authority
Why is this and how can I solve it?
This is because the keys of your old cluster are cached. I'm not sure why they are not updated with the gcloud init command (which can be expected intuitively, or at least some good error message from kubectl)
, :
gcloud container clusters get-credentials YOURCLUSTERHERE --zone YOURCLUSTERZONEHERE
,
gcloud get-credentials < -p > - & alpha; a > --project < a >
GCP
GCP → → →
.
https://cloud.google.com/sdk/gcloud/reference/container/clusters/get-credentials
Step 1: Delete the .kube / config file
step 2: credentials for gcloud clusters YOURCLUSTERHERE
However, if you have any problems, disconnect your current organization network and try using a mobile access point or your Wi-Fi.