TLS handshake timeout with kubernetes in GKE

流过昼夜 提交于 2019-12-06 02:23:10

For others seeing this issue, there is another cause to consider.

After doing:

gcloud config set project $PROJECT_NAME
gcloud config set container/cluster $CLUSTER_NAME
gcloud config set compute/zone europe-west2
gcloud beta container clusters get-credentials $CLUSTER_NAME --region europe-west2 --project $PROJECT_NAME

I was then seeing:

kubectl cluster-info
Unable to connect to the server: net/http: TLS handshake timeout

I tried everything suggested here and elsewhere. When the above worked without issue from my home desktop, I discovered that shared workspace wifi was disrupting TLS/VPNs to control the internet access!

This is what I did to solve the above problem. I simply ran the following commands::

> gcloud container clusters get-credentials {cluster_name} --zone {zone_name} --project {project_name}

> gcloud auth application-default login

Replace the placeholders appropriately.

So this MAY NOT work for you on GKE, but Azure AKS (managed Kubernetes) has a similar problem with the same error message so who knows — this might be helpful to someone.

The solution to this for me was to scale the nodes in my Cluster from the Azure Kubernetes service blade web console.

Workaround / Solution

  1. Log into the Azure (or GKE) Console — Kubernetes Service UI.
  2. Scale your cluster up by 1 node.
  3. Wait for scale to complete and attempt to connect (you should be able to).
  4. Scale your cluster back down to the normal size to avoid cost increases.

Total time it took me ~2 mins.

More Background Info on the Issue

Added this to the full ticket description write up that I posted over here (if you want more info have a read):

'Unable to connect Net/http: TLS handshake timeout' — Why can't Kubectl connect to Azure AKS server?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!