添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams
NAME                                          READY   STATUS             
RESTARTS   AGE
pod/mysql-0                                   1/1     Running            0          72s
pod/nginx-ingress-microk8s-controller-c2pgz   0/1     CrashLoopBackOff   129        22h
pod/web-0                                     1/1     Running            0          78s
NAME                    TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
service/kubernetes      ClusterIP   10.152.183.1   <none>        443/TCP    70m
service/mysql-service   ClusterIP   None           <none>        3306/TCP   72s
service/nginx-service   ClusterIP   None           <none>        80/TCP     78s
NAME                                               DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.apps/nginx-ingress-microk8s-controller   1         1         0       1            0           <none>          2d22h
NAME                     DESIRED   CURRENT   AGE
statefulset.apps/mysql   1         1         72s
statefulset.apps/web     1         1         78s

/var/log/syslog:

failed to load Kubelet config file /var/lib/kubelet/config.yaml, error failed to read kubelet config file "/var/lib/kubelet/config.yaml", error: open /var/lib/kubelet/config.yaml: no such file or directory
Error syncing pod f0ab0f74-e6f2-11e8-8410-482ae31e6a94 ("nginx-ingress-microk8s-controller-c2pgz_default(f0ab0f74-e6f2-11e8-8410-482ae31e6a94)"), skipping: failed to "StartContainer" for "nginx-ingress-microk8s" with CrashLoopBackOff: "Back-off 5m0s restarting failed container=nginx-ingress-microk8s pod=nginx-ingress-microk8s-controller-c2pgz_default(f0ab0f74-e6f2-11e8-8410-482ae31e6a94)"

What is nginx-ingress-microk8s-controller-c2pgz? Who started it?

Is it happening while joining the worker node? Or the system was already running and it started happening? Is /var/lib/kubelet/config.yaml present on the system? – Prafull Ladha Nov 13, 2018 at 9:03 what do you mean by "No"? Can you share information what you are trying to do, your cluster architecture and when exactly you faces with this error? – Vit Nov 13, 2018 at 15:24 I think it is due to the fact that kubeadm init fails: github.com/kubernetes/kubeadm/issues/1239 – Kok How Teh Nov 14, 2018 at 6:02

You mentioned in the comments that the reason is related to kubeadm init fails.

The /var/lib/kubelet/config.yaml config file is being populated only after:

  • A successful cluster initialization (kubeadmin init) in the master node.

  • In the worker node - after a successful joining to the cluster (kubeadm join).

    So if the problem is with kubeadm init you should check the command's output (also great if you could paste it in the question).
    Make sure you don't run kubeadm init with the --ignore-preflight-errors=all flag.

    I'm not familiar with your specific error, but in order for the answer to be more helpful - I'll try to give some possible solutions:

  • Make sure all requirements for kubeadm are in place.

  • Check the firewall rules - make sure you don't block egress traffic and that port 6443 ingress rule is open for the worker node (relevant for the joining phase).

  • Make sure that the required ports are not occupied.

  • Try restarting Kubelet with systemctl restart kubelet and check latest logs with:
    sudo journalctl -u kubelet -n 100 --no-pager.

  • Check if Docker version can be updated to a newer stabler one.

  • Try running kubeadm reset and make sure you re-run kubeadm init with latest version or with the specific stable version by addding --kubernetes-version=X.Y.Z.

    As per RtmY, it works only kubectl initilzation works correct after doing following

    kubeadm  init --pod-network-cidr=192.168.0.0/16
    

    it worked successfully.

    As i have updated kubelet, I am not able to find /var/lib/kubelet/config.yaml

    For that "systemctl status kubelet|journalctl -xe"

    failed to load Kubelet config file /var/lib/kubelet/config.yaml

    As per the below link, I have copied the config.yaml from other working worker nodes and its worked !!

    https://github.com/kubernetes/kubernetes/issues/65863#issuecomment-403003592

    A link to a solution is welcome, but please ensure your answer is useful without it: add context around the link so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. Answers that are little more than a link may be deleted. – double-beep Aug 13, 2019 at 10:49

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.

  •