Kubernetes/Container Engine: TLS handshake timeout

16,994

So i found the problem.

kubernetes was set to use the wrong context and cluster (i had created a GC project and deleted it again, and the created a new project).

I got the new credentials from GC:

gcloud container clusters get-credentials CLUSTER_NAME_FROM_GC

To get the new context name and cluster name i used:

kubectl config view

And to update the current context and cluster i used:

kubectl config set-cluster CLUSTER_NAME_FROM_CREDENTIALS
kubectl config set-context CONTEXT_NAME_FROM_CREDENTIALS

This fixed the problem.

Share:
16,994
Jakob Kristensen
Author by

Jakob Kristensen

Updated on July 02, 2022

Comments

  • Jakob Kristensen
    Jakob Kristensen almost 2 years

    About 7 hours ago i was working with kubectl without problems. Now (after a few hours of sleep, and a reboot of my computer) all kubectl get commands gives me this error:

    Unable to connect to the server: net/http: TLS handshake timeout
    

    I did not do anything since it worked besides shut down my computer.

    Since I'm new with Kubernetes and GCE i need a few hints on what this could be, and where to look.