<blockquote>
<p>kubectl -n namespace1 logs -f podname</p>
</blockquote>
<p>returns the following error.</p>
<blockquote>
<p>Error from server: Get https://ipaddress:10250/containerLogs/namespace1/podname-xxkb9/podname?follow=true: net/http: TLS handshake timeout</p>
</blockquote>
<p>Proxies are unset.</p>
<blockquote>
<p>unset http_proxy<br>
unset https_proxy</p>
</blockquote>

<p>But Still the issue comes.
Could anyone help me with this issue please.</p>

<p>What I know for sure this is not a cert issue. This is API versions mismatching problem or something else related to API. There were a few discussions on stack in the past, I'll attach them in the end. Also, I experienced the same few years ago and at that time I also resolved this problem by <code>kubeadm upgrade</code></p>
<p>First of all check real error message by running <code>kubectl logs -v9</code> for maximum verbosity level.</p>
<p>Most probably you checked other commands like <code>kubectl get pods, nodes</code>, etc. <a href="https://github.com/kubernetes/kubernetes/issues/71343#issuecomment-441605440" rel="nofollow noreferrer">None of those commands</a> require the apiserver to contact the kubelet, only kubectl logs does.
And @Kamos asked you absolutely the right question re: <code>exec/attach/portforward</code>. 99% they also doesn't work for you because they also require contacting kubelet directly.</p>
<p>There are a lot of chances you will fix issue with <a href="https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/" rel="nofollow noreferrer">Upgrading kubeadm clusters</a></p>
<p>References:</p>
<p><strong>1.</strong> <a href="https://stackoverflow.com/questions/51302515/kubernetes-net-http-tls-handshake-timeout-when-fetching-logs-baremetal">Kubernetes - net/http: TLS handshake timeout when fetching logs (BareMetal)</a></p>
<p><strong>2.</strong> <a href="https://stackoverflow.com/a/48335149/9929015">Kubernetes logs command TLS handshake timeout ANSWER1!!!</a></p>
<p><strong>3.</strong> <a href="https://stackoverflow.com/a/51357740/9929015">Kubernetes logs command TLS handshake timeout ANSWER2</a></p>
<p><strong>4.</strong> <a href="https://github.com/kubernetes/kubernetes/issues/71343" rel="nofollow noreferrer">kubectl logs failed with error: net/http: TLS handshake timeout #71343</a></p>
