1

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".

Nibrass H
  • 2,403
  • 1
  • 8
  • 14
Yuva Yuva
  • 21
  • 4
  • 2
    Does 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 Answers1

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