<p>While running commands such as kubectl get nodes resulting with following error:</p>

<p>The connection to the server :6443 was refused - did you specify the right host or port?</p>

<p>I ran systemctl status kubelet.service and receiving the following state:</p>

<pre><code>root@k8s-l2bridge-ma:~# sudo systemctl status kubelet.service

● kubelet.service - kubelet: The Kubernetes Node Agent
   Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/kubelet.service.d
           └─10-kubeadm.conf
   Active: activating (auto-restart) (Result: exit-code) since Tue 2020-06-16 11:46:05 UTC; 9s ago
     Docs: https://kubernetes.io/docs/home/
  Process: 28012 ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS (code=exited, status=255)
 Main PID: 28012 (code=exited, status=255)

Jun 16 11:46:05 k8s-l2bridge-ma systemd[1]: kubelet.service: Failed with result 'exit-code'.
</code></pre>

<p>How can I troubleshoot the failure and find out what is wrong? I found few leads googling but nothing solved the problem.</p>

<p>Just make the modification on the file <code>/etc/systemd/system/kubelet.service.d/10-kubeadm.conf</code></p>

<pre><code>Environment="KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true --fail-swap-on=false"
</code></pre>

<p>then execute commands:</p>

<pre><code> $ systemctl daemon-reload

 $ systemctl restart kubelet
</code></pre>

<p>Take a look: <a href="https://serverfault.com/questions/877136/debug-kubelet-not-starting/880316">fail-kubelet-service</a>, <a href="https://github.com/kubernetes/kubernetes/issues/83936" rel="noreferrer">kubelet-failed-start</a>.</p>
