Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubectl randomly returns "TLS handshake timeout" (running on localhost K8s)

I'm seeing the following error when running kubectl commands against my local cluster (Minikube and through Dockers new Kubernetes functionality)

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

All commands work (create deployment, check pods etc) until this error seemingly randomly rears its head. After the first occurrence of this, it won't stop occurring for any and all kubectl commands rendering kubectl useless. The only way to stop it is to completely destroy the local cluster and start again ... until is happens again 5 minutes later!

Can anyone shed some light onto this please? Please note a lot of people are asking about this sort of issue in regards to AWS, GCE etc and they have different resolutions based on the platform they are running on, I am yet to see a solution for this when it occurs locally.

like image 266
mvee Avatar asked Aug 02 '18 13:08

mvee


1 Answers

Solved by increasing the memory available to Docker from 2gb up to 8gb.

To do this, click on the docker icon -> Preferences -> Advanced, then use the slider for "Memory" to increase the available memory to the docker process as you wish.

@Koshmaar I hope that helps you as well!

like image 52
mvee Avatar answered Nov 15 '22 04:11

mvee