Unable to connect to the server: x509: certificate signed by unknown authority – kubectl error when connecting to gcloud pods. How to fix?
When you are using your kubectl for the first time you would face this error – Unable to connect to the server: x509: certificate signed by unknown authority. To fix this you need to fetching cluster endpoint and auth data from your GCP account and create a kubeconfig entry in your local system.
gcloud container clusters get-credentials <cluster-name> --region <region-id> --project <project-id>
gcloud container clusters get-credentials poopcode-dev-cluster --region us-central1 --project poopcode-dev
Fetching cluster endpoint and auth data. kubeconfig entry generated for poopcode-dev-cluster