5

My vanilla kubernetes cluster running on 'Docker for Mac' was running fine without any real load. Now, I deployed a few services and istio. Now, I am getting this error:

$ kubectl get pods --all-namespaces
Unable to connect to the server: net/http: TLS handshake timeout

Where can I see the kubectl logs?

I am on Mac OS High Sierra. Thank you for reading my post.

user674669
  • 10,681
  • 15
  • 72
  • 105

4 Answers4

11

enter image description here

I increased the RAM to 8GB, CPUs to 4 and swap space to 4GB, restarted Docker For Mac. kubectl works fine now.

user674669
  • 10,681
  • 15
  • 72
  • 105
  • Excellent, for me double all the values was enough to get all up again. on docker-desktop for windows you will find these values on left menù, under Resources section. I set CPUs:4, Memory:4.0GB, Swap:2GB, Disk Image Size:64GB. Then press Apply and Restart. If you face not enough resource error during restart then press restore to default and the retry little lower settings. – Falco Jan 29 '21 at 05:53
  • 1
    Sorry, it is not working for me. CPU: 4, RAM: 8, SWAP: 4. Mac OS Big Sur 11.4. Docker Desktop Version 3.5.1 (3.5.1.7) K8s: 1.21.2 It is stuck in Starting... – aironman Jun 30 '21 at 12:19
  • Same here, using Mac OS Big Sur 11.5.1 Docker Desktop Version 3.3.1 K8s:v1.19.9 – SirGustave Aug 03 '21 at 11:25
  • This worked for me. I am using Mac. – charles Mar 17 '22 at 04:45
1

I had similar issue on two node cluster running Ubuntu server. My master node system time was set to wrong time and date. Which is causing issue with TLS handshake time out. After setting correct system time issue got resolved from me.

/etc/init.d/ntp stop

ntpdate <ntpserver_IP>

Thanks

Jay
  • 41
  • 7
1

To see additional logs you may try "--v=N" option, e.g:

kubectl get pods --all-namespaces --v=9

See https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-output-verbosity-and-debugging

Maciek
  • 111
  • 1
  • 3
0

you need to run the below commands before using kubectl

unset http_proxy
unset https_proxy
Shubham Jain
  • 16,610
  • 15
  • 78
  • 125