"Certificate signed by an unknown authority" error after switching a GCP project

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?

+5
source share
3 answers

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
+12

,

gcloud get-credentials   < -p >   - & alpha; a > --project < a >

GCP

GCP → → →

.

https://cloud.google.com/sdk/gcloud/reference/container/clusters/get-credentials

+1

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.

0
source

All Articles