<p>After restarting the VM, microk8s stopped running.</p>
<pre><code>Executing this command outputs the following:
microk8s status:
microk8s is not running. use microk8s inspect for a deeper inspection.
microk8s kubectl get pod:
The connection to the server 127.0.0.1 16443 was refused did you specify the right host or port?
</code></pre>
<p>I have practically tried all the methods, but there is no result.</p>

Жека Михайленко
<p>Run <em>ps -ef | grep kubelet</em></p>
<p>Output will be somewhat like this:</p>
<p><em>root       934     1  5 08:17 ?        00:20:40 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=<strong>/etc/kubernetes/kubelet.conf</strong> --config=/var/lib/kubelet/config.yaml --network-plugin=cni --pod-infra-container-image=k8s.gcr.io/pause:3.2</em></p>
<p>Look for path of <em>kubelet.conf</em> and then edit port in that file. On this port, kubelet connects with kube-apiserver. Once it's fixed, output of <em>kubectl cluster-info</em> should be somewhat like this:</p>
<p><em>Kubernetes control plane is running at <a href="https://192.168.56.2:6443" rel="nofollow noreferrer">https://192.168.56.2:6443</a>
KubeDNS is running at <a href="https://192.168.56.2:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy" rel="nofollow noreferrer">https://192.168.56.2:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy</a>
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.</em></p>
