flanneld网络异常问题

pod之间网络不通,ip addr正常

查看etcd中flanneld的内容

[root@k8s-master k8s-ansible]# etcdctl ls /coreos.com/network/subnets
/coreos.com/network/subnets/172.17.77.0-24
/coreos.com/network/subnets/172.17.76.0-24
[root@k8s-master k8s-ansible]# etcdctl get /coreos.com/network/subnets/172.17.77.0-24
{"PublicIP":"10.254.0.140"}
[root@k8s-master k8s-ansible]# etcdctl get /coreos.com/network/subnets/172.17.76.0-24
{"PublicIP":"10.0.3.15"}

发现内容异常

解决方案,去掉10.0.3.15的网卡,删除掉flanneld的key,重新设置flanneld

错误2

E0502 16:30:41.181406 3775 summary.go:92] Failed to get system container stats for "/system.slice/docker.service": failed to get cgroup stats for "/system.slice/docker.service": failed to get container info for "/system.slice/docker.service": unknown container "/system.slice/docker.service"

通过查看flanneld

[root@k8s-node1 ~]# systemctl status flanneld
● flanneld.service - flanneld overlay address etcd agent
   Loaded: loaded (/usr/lib/systemd/system/flanneld.service; disabled; vendor preset: disabled)
   Active: active (running) since 四 2019-05-02 16:26:19 CST; 16min ago
 Main PID: 3438 (flanneld)
   CGroup: /system.slice/flanneld.service

发现flanneld的CGroup为/system.slice/flanneld.service
故kubelet中添加内容

--runtime-cgroups=/system.slice/flanneld.service --kubelet-cgroups=/system.slice/flanneld.service