标签:extern lib work restart name docker 2-2 ddr rmi
系统日志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         4h50m
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 5h22m)  kubelet, ubuntu  Pod sandbox changed, it will be killed and re-created.
Warning  FailedCreatePodSandBox  2m38s (x4381 over 5h22m)  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
标签:extern lib work restart name docker 2-2 ddr rmi
原文地址:https://blog.51cto.com/appop/2473461