In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
K8S Flannel network plug-in installation process is how, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
I. the role of flannel
1. The main function of CNI network plug-in is to realize that POD resources can be trusted across hosts.
# test-nodes1 host cannot ping the pod container of test-nodes2 host [root@test-nodes1] # kubectl get pods-o wideNAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATESnginx-ds1-qg45q 1 Running 0 2d12h 172.7.22.3 test-nodes2.cedarhd.com nginx-ds1-whnmv 1 Running 0 2d12h 172.7.21.3 test-nodes1.cedarhd.com [root@test-nodes1 ~] # ping 172.7.22.3PING 172.7.22.3 (172.7.22.3) 56 (84) bytes of data ^ C-172.7.22.3 ping statistics-8 packets transmitted 0 received, 100% packet loss Time 6999ms II. Flannel installation # this operation requires operating [root@test-nodes1 ~] # cd / opt/src/ [root@test-nodes1 src] # wget https://github.com/coreos/flannel/releases/download/v0.11.0/flannel-v0.11.0-linux-amd64.tar.gz[root@test-nodes1 src] # mkdir / opt/flannel-v0.11.0 [root@test-nodes1 src] # tar xf flannel-v0 on test-nodes1 and test-nodes2, respectively. 11.0-linux-amd64.tar.gz-C / opt/flannel-v0.11.0/ [root@test-nodes1 src] # ln-s / opt/flannel-v0.11.0/ / opt/flannel [root@test-nodes1 src] # cd / opt/flannel [root@test-nodes1 flannel] # mkdir cert [root@test-nodes1 flannel] # cd cert/ [root@test-nodes1 cert] # scp test-operator:/opt/certs/ca.pem. Root@test-operator's password : ca.pem 1346 173.2KB/s 00:00 [root@test-nodes1 cert] # scp test-operator:/opt/certs/client.pem. Root@test-operator's password: client.pem 1363 207.0KB/s 00:00 [root@test-nodes1 cert] # scp test-operator:/opt/certs/client-key.pem. Root@test-operator's password: client-key.pem [root@test-nodes1 cert] # cd.. flashes] # vi subnet.envFLANNEL_NETWORK=172.7.0.0/16FLANNEL_SUBNET=172.7.21.1/24 # the subnet of each nodes needs to be modified Test-nodes1 is 21 And test-nodes2 is 22FLANNEL_MTU=1500FLANNEL_IPMASQ=falseflannel] # vi flanneld.sh #! / bin/sh./flanneld\-- public-ip=10.3.153.221\ # another test-nodes2 needs to be modified-- etcd-endpoints= https://10.3.153.212:2379,https://10.3.153.221:2379, Https://10.3.153.222:2379\-- etcd-keyfile=./cert/client-key.pem\-- etcd-certfile=./cert/client.pem\-- etcd-cafile=./cert/ca.pem\-- iface=ens33\-- subnet-file=./subnet.env\-- healthz-port=2401 [root@test-nodes1 flannel] # cd / opt/etcd# this step can be performed on an one-step machine. You only need to execute [root@test-nodes1 etcd] #. / etcdctl set / coreos.com/network/config'{"Network": "172.7.0.0host-gw 16", "Backend": {"Type": "host-gw"}'{"Network": "172.7.0.0Comp16" "Backend": {"Type": "host-gw"}} [root@test-nodes1 etcd] # vi / etc/supervisord.d/ flannel.ini [program: flanneld-7-21] command=/opt/flannel/flanneld.sh The program (relative uses PATH, can take args) numprocs=1; number of processes copies tostart (def 1) directory=/opt/flannel; directory to cwd to before exec (def no cwd) autostart=true Start at supervisord start (default: true) autorestart=true; retstart at unexpected quit (default: true) startsecs=30; number of secs prog must stay running (def. 1) startretries=3; max # of serial start failures (default 3) exitcodes=0,2; 'expected' exitcodes for process (default 0Magne2) stopsignal=QUIT Signal used to kill process (default TERM) stopwaitsecs=10; max num secs to wait b4 SIGKILL (default 10) user=root; setuid to this UNIX account to run the programredirect_stderr=true Redirect proc stderr to stdout (default false) stdout_logfile=/data/logs/flanneld/flanneld.stdout.log; stderr log path, NONE for none; default AUTOstdout_logfile_maxbytes=64MB; max # logfile bytes b4 rotation (default 50MB) stdout_logfile_backups=4; # of stdout logfile backups (default 10) stdout_capture_maxbytes=1MB Number of bytes in 'capturemode' (default 0) stdout_events_enabled=false Emit events on stdout writes (default false) [root@test-nodes1 etcd] # supervisorctl updateflanneld-7-21: added process group [root@test-nodes1 flannel] # supervisorctl statusetcd-server-7-21 RUNNING pid 14828, uptime 2 days, 14:55:02flanneld-7-21 RUNNING pid 26991, uptime 0:00:48kube-apiserver-7-21 RUNNING pid 14810, uptime 2 days, 14:56:17kube-controller-manager-7-21 RUNNING pid 14868 Uptime 2 days, 14:46:46kube-kubelet-7-21 RUNNING pid 15095, uptime 2 days, 13:46:15kube-proxy-7-21 RUNNING pid 22013, uptime 2 days, 13:05:18kube-scheduler-7-21 RUNNING pid 25120, uptime 2 days, 12:53:29 3, flannel working principle
1. In the host-gw model, when the two computing nodes are in the same network segment, the corresponding routing tables will be added for the two computing nodes when flannel is started. At this time, the POD of the two computing nodes can communicate with each other, and the flannel exit will not be affected, because the routing table has been added to the host.
2. VxLAN model, where two computing nodes are in different network segments.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.