简体   繁体   English

microk8s 没有运行。 使用 microk8s 检查进行更深入的检查

[英]microk8s is not running. use microk8s inspect for a deeper inspection

After restarting the VM, microk8s stopped running.重启VM后,microk8s停止运行。

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?

I have practically tried all the methods, but there is no result.我几乎尝试了所有方法,但没有结果。

Run ps -ef |运行ps -ef | grep kubelet grep kubelet

Output will be somewhat like this: Output 会有点像这样:

root 934 1 5 08:17?根 934 1 5 08:17? 00:20:40 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig= /etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --network-plugin=cni --pod-infra-container-image=k8s.gcr.io/pause:3.2 00:20:40 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig= /etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/ config.yaml --network-plugin=cni --pod-infra-container-image=k8s.gcr.io/pause:3.2

Look for path of kubelet.conf and then edit port in that file.查找kubelet.conf的路径,然后在该文件中编辑端口。 On this port, kubelet connects with kube-apiserver.在这个端口上,kubelet 与 kube-apiserver 连接。 Once it's fixed, output of kubectl cluster-info should be somewhat like this:修复后, kubectl cluster-info的 output 应该有点像这样:

Kubernetes control plane is running at https://192.168.56.2:6443 KubeDNS is running at https://192.168.56.2:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. Kubernetes control plane is running at https://192.168.56.2:6443 KubeDNS is running at https://192.168.56.2:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy To further调试和诊断集群问题,使用“kubectl cluster-info dump”。

Here the port is incorrect.这里的端口不正确。 It should be 6443 and not 16443. You can correct the port on master node in /etc/kubernetes/kubelet.conf file.它应该是 6443 而不是 16443。您可以在/etc/kubernetes/kubelet.conf文件中更正主节点上的端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM