flannel CrashLoopBackOff原因

系统日志
Feb 25 14:20:31 ubuntu systemd[1]: Started libcontainer container 15b23c11b8fee60349fd84e928d04d6fd26b9f04c0aadbc5aebde97d77765c8f.
Feb 25 14:20:31 ubuntu kernel: [166679.978936] IPVS: Creating netns size=2200 id=10507
Feb 25 14:20:31 ubuntu kubelet[32051]: W0225 14:20:31.532551 32051 docker_sandBox.go:394] Failed to read pod IP from plugin/docker: networkPlugin cni Failed on the status hook for pod "coredns-6955765f44-5mbc5_kube-system": CNI Failed to retrieve network namespace path: cannot find network namespace for the terminated container "e47f543f22801a9b5e7b24ff4bc040f4b88d01e8f640f5de1d29c9e4e1b9a527"
Feb 25 14:20:31 ubuntu kubelet[32051]: W0225 14:20:31.541562 32051 pod_container_deletor.go:75] Container "e47f543f22801a9b5e7b24ff4bc040f4b88d01e8f640f5de1d29c9e4e1b9a527" not found in pod's containers
Feb 25 14:20:31 ubuntu kubelet[32051]: W0225 14:20:31.543113 32051 cni.go:331] CNI Failed to retrieve network namespace path: cannot find network namespace for the terminated container "e47f543f22801a9b5e7b24ff4bc040f4b88d01e8f640f5de1d29c9e4e1b9a527"
Feb 25 14:20:31 ubuntu kubelet[32051]: W0225 14:20:31.981118 32051 pod_container_deletor.go:75] Container "15b23c11b8fee60349fd84e928d04d6fd26b9f04c0aadbc5aebde97d77765c8f" not found in pod's containers
Feb 25 14:20:31 ubuntu kubelet[32051]: E0225 14:20:31.983964 32051 cni.go:364] Error adding kube-system_coredns-6955765f44-vk7lt/15b23c11b8fee60349fd84e928d04d6fd26b9f04c0aadbc5aebde97d77765c8f to network flannel/cbr0: open /run/flannel/subnet.env: no such file or directory
Feb 25 14:20:32 ubuntu kubelet[32051]: E0225 14:20:32.250576 32051 pod_workers.go:191] Error syncing pod 4a4c9415-eb46-4fb9-86cb-ad939dc4abf1 ("kube-flannel-ds-amd64-zxxn5_kube-system(4a4c9415-eb46-4fb9-86cb-ad939dc4abf1)"), skipping: Failed to "StartContainer" for "kube-flannel" with CrashLoopBackOff: "back-off 5m0s restarting Failed container=kube-flannel pod=kube-flannel-ds-amd64-zxxn5_kube-system(4a4c9415-eb46-4fb9-86cb-ad939dc4abf1)"
Feb 25 14:20:32 ubuntu containerd[1898]: time="2020-02-25T14:20:32.256414559+08:00" level=info msg="shim containerd-shim started" address="/containerd-shim/moby/c01e85bda34b4a7183f8933c2ebdae7d3ac2bfdb25861f41dcad42f5f8d2c7c0/shim.sock" debug=false pid=22523

root@ubuntu:~# kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-6955765f44-5mbc5 0/1 ContainerCreating 0 5h8m
kube-system coredns-6955765f44-vk7lt 0/1 ContainerCreating 0 5h8m
kube-system etcd-ubuntu 1/1 Running 0 5h8m
kube-system kube-apiserver-ubuntu 1/1 Running 0 5h8m
kube-system kube-controller-manager-ubuntu 1/1 Running 6 5h8m
kube-system kube-flannel-ds-amd64-zxxn5 0/1 CrashLoopBackOff 60 4h60m
kube-system kube-proxy-ktnlr 1/1 Running 0 5h8m
kube-system kube-scheduler-ubuntu 1/1 Running 9 5h8m

root@ubuntu:~# kubectl logs kube-flannel-ds-amd64-zxxn5 -n kube-system
I0225 06:17:30.694624 1 main.go:514] Determining IP address of default interface
I0225 06:17:30.695221 1 main.go:527] Using interface with name enp0s31f6 and address 192.168.5.24
I0225 06:17:30.695258 1 main.go:544] Defaulting external address to interface address (192.168.5.24)
I0225 06:17:30.802692 1 kube.go:126] Waiting 10m0s for node controller to sync
I0225 06:17:30.802823 1 kube.go:309] Starting kube subnet manager
I0225 06:17:31.804762 1 kube.go:133] Node controller sync successful
I0225 06:17:31.804853 1 main.go:244] Created subnet manager: Kubernetes subnet Manager - ubuntu
I0225 06:17:31.804867 1 main.go:247] Installing signal handlers
I0225 06:17:31.805019 1 main.go:386] Found network config - Backend type: vxlan
I0225 06:17:31.805131 1 vxlan.go:120] VXLAN config: VNI=1 Port=0 GBP=false DirectRouting=false
E0225 06:17:31.805533 1 main.go:289] Error registering network: Failed to acquire lease: node "ubuntu" pod cidr not assigned
I0225 06:17:31.805614 1 main.go:366] Stopping shutdownHandler..

normal SandBoxChanged 7m38s (x4319 over 5h32m) kubelet, ubuntu Pod sandBox changed, it will be killed and re-created.
Warning FailedCreatePodSandBox 2m38s (x4381 over 5h32m) kubelet, ubuntu (combined from similar events): Failed to create pod sandBox: rpc error: code = UnkNown desc = Failed to set up sandBox container "e477bc3cf44820f2df210fb0da08c6be6412c7fa36d07ced77c7806203b7c87a" network for pod "coredns-6955765f44-5mbc5": networkPlugin cni Failed to set up pod "coredns-6955765f44-5mbc5_kube-system" network: open /run/flannel/subnet.env: no such file or directory

3m53s       normal    SandBoxChanged           pod/coredns-6955765f44-5mbc5      Pod sandBox changed, it will be killed and re-created.

8m51s Warning FailedCreatePodSandBox pod/coredns-6955765f44-5mbc5 (combined from similar events): Failed to create pod sandBox: rpc error: code = UnkNown desc = Failed to set up sandBox container "4c63e068defce69cb2c506c580b88ea8b220aba55e819c49ad34dbaa82945885" network for pod "coredns-6955765f44-5mbc5": networkPlugin cni Failed to set up pod "coredns-6955765f44-5mbc5_kube-system" network: open /run/flannel/subnet.env: no such file or directory
28m normal SandBoxChanged pod/coredns-6955765f44-vk7lt Pod sandBox changed, it will be killed and re-created.
3m49s Warning FailedCreatePodSandBox pod/coredns-6955765f44-vk7lt (combined from similar events): Failed to create pod sandBox: rpc error: code = UnkNown desc = Failed to set up sandBox container "a4c24117ec668b952176f3be8db86303bf4c2dc08deeb8a44146fbee56853208" network for pod "coredns-6955765f44-vk7lt": networkPlugin cni Failed to set up pod "coredns-6955765f44-vk7lt_kube-system" network: open /run/flannel/subnet.env: no such file or directory

是安装Kubeadm Init的时候,没有增加 --pod-network-cidr 10.244.0.0/16参数。

注意看日志
Error registering network: Failed to acquire lease: node "ubuntu" pod cidr not assigned

相关文章

今天小编给大家分享一下excel图案样式如何设置的相关知识点,...
这篇文章主要讲解了“win10设置过的壁纸如何删除”,文中的讲...
这篇“Xmanager怎么显示远程linux程序的图像”文章的知识点大...
今天小编给大家分享一下xmanager怎么连接linux的相关知识点,...
这篇“如何重置Linux云服务器的远程密码”文章的知识点大部分...
本篇内容介绍了“Linux云服务器手动配置DNS的方法是什么”的...