解压flannel包
tar xf flannel-v0.11.0-linux-amd64.tar.gz
mv flanneld mk-docker-opts.sh /usr/bin/
chmod +x /usr/bin/flanneld
chmod +x /usr/bin/mk-docker-opts.sh
配置flanneld.service文件
cat> /etc/systemd/system/flanneld.service<<EOF
[Unit]
Description=Flanneld
Documentation=https://github.com/coreos/flannel
After=network.target
Before=docker.service
[Service]
User=root
ExecStartPost=/usr/bin/mk-docker-opts.sh
ExecStart=/usr/bin/flanneld \
--etcd-endpoints=http://10.0.102.215:2379 \
--iface=10.0.102.215 \
--ip-masq=true \
--etcd-prefix=/coreos.com/network
Restart=on-failure
Type=notify
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
启动
systemctl enable flanneld
systemctl restart flanneld
网友评论