参考:
K8s问题【flannel一直重启问题,CrashLoopBackOff】
https://www.cnblogs.com/360linux/p/12933594.html
作为一名合格的管理者,首先查看日志

[root@master ~]# kubectl get pods -n kube-system
NAME                             READY   STATUS              RESTARTS   AGE
coredns-5bfd685c78-795kh         0/1     ContainerCreating   0          137m
coredns-5bfd685c78-rlzs2         0/1     ContainerCreating   0          137m
etcd-master                      1/1     Running             0          136m
kube-apiserver-master            1/1     Running             0          136m
kube-controller-manager-master   1/1     Running             0          136m
kube-flannel-ds-djr26            0/1     Error               15         63m
kube-flannel-ds-fk225            0/1     CrashLoopBackOff    10         30m
kube-flannel-ds-jhd6p            0/1     CrashLoopBackOff    17         63m
kube-proxy-6r25s                 1/1     Running             0          137m
kube-proxy-m8gxx                 1/1     Running             0          136m
kube-proxy-s2jb8                 1/1     Running             0          136m
kube-scheduler-master            1/1     Running             0          136m
[root@master ~]# kubectl logs kube-flannel-ds-djr26 -n kube-system
I0528 11:36:04.076849       1 main.go:201] Could not find valid interface matching enss33: error looking up interface enss33: route ip+net: no such network interface
I0528 11:36:04.077557       1 main.go:201] Could not find valid interface matching eth0: error looking up interface eth0: route ip+net: no such network interface
E0528 11:36:04.077564       1 main.go:225] Failed to find interface to use that matches the interfaces and/or regexes provided

由于flannel需要调用内核模块,请确保这些模块已经安装完成

加载ipvs相关内核模块
如果重新开机,需要重新加载(可以写在 /etc/rc.local 中开机自动加载)
# modprobe ip_vs
# modprobe ip_vs_rr
# modprobe ip_vs_wrr
# modprobe ip_vs_sh
# modprobe nf_conntrack_ipv4
查看是否加载成功
# lsmod | grep ip_vs
ip_vs_sh               12688  0 
ip_vs_wrr              12697  0 
ip_vs_rr               12600  0 
ip_vs                 145497  6 ip_vs_rr,ip_vs_sh,ip_vs_wrr
nf_conntrack          133095  9 ip_vs,nf_nat,nf_nat_ipv4,nf_nat_ipv6,xt_conntrack,nf_nat_masquerade_ipv4,nf_conntrack_netlink,nf_conntrack_ipv4,nf_conntrack_ipv6
libcrc32c              12644  4 xfs,ip_vs,nf_nat,nf_conntrack
GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐