K8S利用etcd修复节点网络故障
K8S 通过etcd恢复错误节点的网络信息
以下操作均不能执行 export ETCDCTL_API=3
etcdctl --endpoints=https://192.168.0.219:2379,https://192.168.0.220:2379,https://192.168.0.221:2379 --ca-file=/etc/kubernetes/ssl/k8s-root-ca.pem --cert-file=/etc/kubernetes/ssl/kubernetes.pem --key-file=/etc/kubernetes/ssl/kubernetes-key.pem ls /kubernetes/network/subnets/ (etcdv2查看节点网络信息)
etcdctl --endpoints=https://192.168.0.219:2379,https://192.168.0.220:2379,https://192.168.0.221:2379 --ca-file=/etc/kubernetes/ssl/k8s-root-ca.pem --cert-file=/etc/kubernetes/ssl/kubernetes.pem --key-file=/etc/kubernetes/ssl/kubernetes-key.pem rm /kubernetes/network/subnets/xxxx (etcdv2 删除错误网络节点的信息)
删除错误节点/run/flannel 下的所有文件
同事重启apiserver 和 错误节点的flanneld
//flannel network配置
# etcdctl --endpoints http://127.0.0.1:{etcd listen port} get /coreos.com/network/config
{"Network":"172.16.0.0/16", "Backend": {"Type": "vxlan"}}
# etcdctl --endpoints http://127.0.0.1:{etcd listen port} ls /coreos.com/network/subnets
/coreos.com/network/subnets/172.16.99.0-24
/coreos.com/network/subnets/172.16.57.0-24
//某一node上的flanne subnet和vtep配置
# etcdctl --endpoints http://127.0.0.1:{etcd listen port} get /coreos.com/network/subnets/172.16.99.0-24
{"PublicIP":"{master node ip}","BackendType":"vxlan","BackendData":{"VtepMAC":"b6:bf:4c:81:cf:3b"}}
minion node:
# etcdctl --endpoints http://127.0.0.1:{etcd listen port} get /coreos.com/network/subnets/172.16.57.0-24
{"PublicIP":"{minion node ip}","BackendType":"vxlan","BackendData":{"VtepMAC":"d6:51:2e:80:5c:69"}}
更多推荐


所有评论(0)