jmeter怎么编写socket脚本
274
2022-09-07
【K8S运维知识汇总】第3天4:详解flanneld工作原理
flanneld实际上只是在宿主机上的路由表中添加了静态路由来完成通信
[root@hdss7-21 ~]# route -n
清除原有规划,实验VxLAN模型
[root@hdss7-21 ~]# supervisorctl stop flanneld-7-21flanneld-7-21: stopped[root@hdss7-21 ~]# supervisorctl statusetcd-server-7-21 RUNNING pid 12272, uptime 6 days, 21:27:13flanneld-7-21 STOPPED Jul 03 09:46 AMkube-apiserver-7-21 RUNNING pid 13277, uptime 5 days, 22:00:54kube-controller-manager-7-21 RUNNING pid 64267, uptime 1 day, 23:23:01kube-kubelet-7-21 RUNNING pid 17290, uptime 4 days, 15:21:44kube-proxy-7-21 RUNNING pid 55520, uptime 4 days, 12:07:09kube-scheduler-7-21 RUNNING pid 64261, uptime 1 day, 23:23:01[root@hdss7-21 ~]# ps -ef | grep flanneldroot 26835 1 0 07:08 ? 00:00:03 ./flanneld --public-ip=10.4.7.21 --etcd-endpoints=--etcd-keyfile=./cert/client-key.pem --etcd-certfile=./cert/client.pem --etcd-cafile=./cert/ca.pem --iface=ens33 --subnet-file=./subnet.env --healthz-port=2401root 66841 55814 0 09:46 pts/2 00:00:00 grep --color=auto flanneld[root@hdss7-21 ~]# kill -9 26835[root@hdss7-21 ~]# route -nKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface0.0.0.0 10.4.7.254 0.0.0.0 UG 100 0 0 ens3310.4.7.0 0.0.0.0 255.255.255.0 U 100 0 0 ens33172.7.21.0 0.0.0.0 255.255.255.0 U 0 0 0 docker0172.7.22.0 10.4.7.22 255.255.255.0 UG 0 0 0 ens33[root@hdss7-21 ~]# route del -net 172.7.22.0/24 gw 10.4.7.22[root@hdss7-21 ~]# route -nKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface0.0.0.0 10.4.7.254 0.0.0.0 UG 100 0 0 ens3310.4.7.0 0.0.0.0 255.255.255.0 U 100 0 0 ens33172.7.21.0 0.0.0.0 255.255.255.0 U 0 0 0 docker0# 清除etcd配置[root@hdss7-22 etcd]# ./etcdctl rm /coreos.com/network/configPrevNode.Value: {"Network": "172.7.0.0/16", "Backend": {"Type": "host-gw"}}[root@hdss7-22 etcd]# ./etcdctl get /coreos.com/network/configError: 100: Key not found (/coreos.com/network/config) [23]
启动supervisord服务,并查看网卡信息
[root@hdss7-21 ~]# supervisorctl start flanneld-7-21flanneld-7-21: started[root@hdss7-21 ~]# supervisorctl status[root@hdss7-21 ~]# ifconfigdocker0: flags=4163
直接路由模式
#智能模式,根据网络flanneld自行选择不同的模式
set /coreos.com/network/config '{"Network": "172.7.0.0/16", "Backend": {"Type": "VxLAN","Directrouting":"true"}}'PrevNode.Value: {"Network": "172.7.0.0/16", "Backend": {"Type": "VxLAN"}}
手动实现flanneld功能
手动添加路由表:
10.4.7.22主机上添加路由表:
10.4.7.21主机上添加路由表:
修改iptables规则:
10.4.7.21主机上添加iptables规则:
10.4.7.22主机上添加iptables规则:
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~