While I'm trying to get the pods or node states, from Google Cloud Platform Cloud Shell, I'm facing this error? Can someone please help me? I can see the output of the "kubectl config view".
Asked
Active
Viewed 1,427 times
1
-
2Does this answer your question? [Unable to connect to the server: dial tcp i/o time out](https://stackoverflow.com/questions/49260135/unable-to-connect-to-the-server-dial-tcp-i-o-time-out) – Roar S. Sep 05 '20 at 21:33
1 Answers
0
Posting this answer as community wiki for better visibility and the fact that the possible solution was posted in the comments:
Does this answer your question? Unable to connect to the server: dial tcp i/o time out
Adding to that:
Below command:
$ kubectl config view
is used to show the configuration stored in your ./kube/config
file. The fact that you can see the output of this command doesn't mean you have correct cluster configured to use with kubectl
.
From the perspective of Google Cloud Platform
and Cloud Shell
There is an official documentation regarding troubleshooting issues with GKE
:
There could be several reasons why you are getting following error:
- You are referencing wrong cluster in your
~/.kube/config
file.$ gcloud container clusters get-credentials CLUSTER_NAME --zone=ZONE
- you will need to run this command to fetch the correct configuration- You can also get above command from the
Kubernetes Engine
page (Connect
button)
- You are referencing a cluster in your
~/.kube/config
file that was deleted - You created Private GKE cluster
For more information you can look in the Cloud Console -> Kubernetes Engine -> CLUSTER_NAME
You can also run:
$ gcloud container clusters list
- this command will show clusters and their state (status) they are in$ gcloud container clusters describe CLUSTER_NAME --zone=ZONE
- this command will show you the configuration of the cluster

Isopycnal Oscillation
- 3,234
- 6
- 21
- 37

Dawid Kruk
- 8,982
- 2
- 22
- 45
-
the kubectl commands were working fine but all the sudden they stopped worked for all the gke cluster... – Yuva Yuva Sep 07 '20 at 12:55
-
Did they stop working for a single cluster, all of the clusters when you tried to change contexts? Have you experienced any network connectivity issues when you tried to connect to your clusters? Have you tried to use `Cloud Shell`? – Dawid Kruk Sep 14 '20 at 11:03
-
-
Have you implemented any firewall rules that could deny the access to your clusters? – Dawid Kruk Sep 28 '20 at 13:10
-