flannel

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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值