kubectl: net/http: TLS handshake timeout

1/9/2018

I followed the Quickstart docs (here) to deploy a k8s cluster in the Western Europe region. The cluster boots up fine, but I cannot connect to it using kubectl - kubectl times out while trying to perform a TLS handshake:

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

There is currently a github issue where others are reporting the same problem.

Following some advice on the thread, I attempted to perform an upgrade from 1.8.1 to 1.8.2, which failed:

bash-4.3# az aks upgrade --resource-group=k8s --name=phlo -k 1.8.2
Kubernetes may be unavailable during cluster upgrades.
Are you sure you want to perform this operation? (y/n): y
 / Running ..
Deployment failed. Correlation ID: <redacted>. Operation failed with status: 200. Details: Resource state Failed

According to others on the github thread, it seems to be a region-specific issue.

-- John Hamelink
azure
azure-container-service
kubernetes

2 Answers

1/11/2018

I was able to get a working AKS setup after ignoring the Azure CLI response on when the k8s cluster was ready, and watching for the "creating..." bar in the AKS overview section of Azure Console to disappear.

There's some good comments here if you are still stuck: https://github.com/Azure/AKS/issues/112

-- John Hamelink
Source: StackOverflow

6/6/2018

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

Workaround / Solution

An interesting solution (worked for me!) to test...

  1. Log into the Azure Console — Kubernetes Service blade.
  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?

-- Necevil
Source: StackOverflow