Weirdly, I am unable to connect to GKE cluster from Local (Mac) via Kubectl, But I can connect from the Google cloud shell? I have fetch the K8s creds which I can see the kubeconfig file, still I am getting timeout. Any suggestions what might be wrong?
$ gcloud components install kubectl
Your current Cloud SDK version is: 367.0.0
Installing components from version: 367.0.0
┌─────────────────────────────────────────────┐
│ These components will be installed. │
├────────────────────────┬─────────┬──────────┤
│ Name │ Version │ Size │
├────────────────────────┼─────────┼──────────┤
│ gke-gcloud-auth-plugin │ 0.1.1 │ 3.4 MiB │
│ kubectl │ 1.20.8 │ 89.0 MiB │
│ kubectl │ 1.20.8 │ < 1 MiB │
└────────────────────────┴─────────┴──────────┘
For the latest full release notes, please visit:
https://cloud.google.com/sdk/release_notes
Do you want to continue (Y/n)? Y
╔════════════════════════════════════════════════════════════╗
╠═ Creating update staging area ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: gke-gcloud-auth-plugin ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: gke-gcloud-auth-plugin ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: kubectl ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: kubectl ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Creating backup and activating new installation ═╣
╚════════════════════════════════════════════════════════════╝
Performing post processing steps...done.
Update done!
$ gcloud auth login
Your browser has been opened to visit:
https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=xxxxxxxxxxxxxxxxxxx
You are now logged in as [atul@xxxxx.com].
Your current project is [test-dev-k8s]. You can change this setting by running:
$ gcloud container clusters get-credentials test-dev-k8s-cluster --region asia-south1 --project test-dev-k8s
Fetching cluster endpoint and auth data.
kubeconfig entry generated for test-dev-k8s-cluster.
$ kubectl get ns
Unable to connect to the server: dial tcp 34.93.111.251:443: i/o timeout