NODE节点【节点配置】
https://github.com/coreos/flannel/releases/tag/v0.9.1
https://github.com/coreos/flannel/releases/tag/v0.10.0
wget -c https://github.com/coreos/flannel/releases/download/v0.9.1/flannel-v0.9.1-linux-amd64.tar.gz
wget -c https://github.com/coreos/flannel/releases/download/v0.10.0/flannel-v0.10.0-linux-amd64.tar.gz
etcdctl -endpoint="http://0.0.0.0:2379" set /coreos.com/network/config '{"Network":"192.18.0.0/16","Backend":{"Type":"vxlan"}}'
tar xvf flannel-v0.9.1-linux-amd64.tar.gz
mv flanneld mk-docker-opts.sh /usr/bin/
配置flanneld
vim /etc/sysconfig/flanneld
FLANNEL_OPTIONS="--etcd-endpoints=http://192.168.5.20:2379 --ip-masq=true"
配置flanneld服务并分发到种NODE:
vim /usr/lib/systemd/system/flanneld.service
[Unit]
Description=Flanneld overlay address etcd agent
After=network.target
After=network-online.target
Wants=network-online.target
Before=docker.service
[Service]
Type=notify
EnvironmentFile=/etc/sysconfig/flanneld
ExecStart=/usr/bin/flanneld $FLANNEL_OPTIONS
ExecStartPost=/usr/bin/mk-docker-opts.sh -k DOCKER_NETWORK_OPTIONS -d /run/flannel/subnet.evn
Restart=on-failure
[Install]
WantedBy=multi-user.target
RequiredBy=docker.service
配置Docker网段:
vim /usr/lib/systemd/system/docker.service
ExecStartPost=/sbin/iptables -I FORWARD -s 0.0.0.0/0 -j ACCEPT
EnvironmentFile=/run/flannel/subnet.env
ExecStart=/usr/bin/dockerd $DOCKER_NETWORK_OPTIONS
systemctl daemon-reload
systemctl enable flanneld
systemctl start flanneld
systemctl status flanneld
systemctl restart docker
flannel
最新推荐文章于 2022-05-01 18:04:28 发布