首页 > 其他 > 详细

flanneld v0.10.0 版本部署

时间:2018-12-08 23:41:36      阅读:316      评论:0      收藏:0      [点我收藏+]
flanneld v0.10.0 版本部署

部署

可先参考 http://blog.51cto.com/hequan/2327820 部署etcd
cd /data/ssl/etcd/

/opt/etcd/bin/etcdctl --ca-file=ca.pem --cert-file=server.pem --key-file=server-key.pem --endpoints="https://192.168.100.100:2379,https://192.168.100.101:2379,https://192.168.100.102:2379" set /coreos.com/network/config  ‘{ "Network": "172.17.0.0/16", "Backend": {"Type": "vxlan"}}‘
  • node01
  • node02
cd /data/src/

wget https://github.com/coreos/flannel/releases/download/v0.10.0/flannel-v0.10.0-linux-amd64.tar.gz

mkdir /opt/kubernetes/bin -p
tar xf flannel-v0.10.0-linux-amd64.tar.gz
mv flanneld mk-docker-opts.sh  /opt/kubernetes/bin/

mkdir  /opt/kubernetes/cfg 

vim /opt/kubernetes/cfg/flanneld
FLANNEL_OPTIONS="--etcd-endpoints=https://192.168.100.100:2379,https://192.168.100.101:2379,https://192.168.100.102:2379 -etcd-cafile=/opt/etcd/ssl/ca.pem -etcd-certfile=/opt/etcd/ssl/server.pem -etcd-keyfile=/opt/etcd/ssl/server-key.pem"

vim /usr/lib/systemd/system/flanneld.service
[Unit]
Description=Flanneld overlay address etcd agent
After=network-online.target network.target
Before=docker.service

[Service]
Type=notify
EnvironmentFile=/opt/kubernetes/cfg/flanneld
ExecStart=/opt/kubernetes/bin/flanneld --ip-masq $FLANNEL_OPTIONSExecStartPost=/opt/kubernetes/bin/mk-docker-opts.sh -k DOCKER_NETWORK_OPTIONS -d /run/flannel/subnet.env
Restart=on-failure

[Install]
WantedBy=multi-user.target

vim  /usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
Type=notify
EnvironmentFile=/run/flannel/subnet.env
ExecStart=/usr/bin/dockerd $DOCKER_NETWORK_OPTIONSExecReload=/bin/kill -s HUP $MAINPIDLimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TimeoutStartSec=0Delegate=yesKillMode=process
Restart=on-failure
StartLimitBurst=3StartLimitInterval=60s

[Install]
WantedBy=multi-user.target

systemctl daemon-reload
systemctl start flanneld
systemctl enable flanneld
systemctl restart docker

检查

ps -ef |grep docker
ip addr

确保docker0与flannel.1在同一网段。
测试不同节点互通,在当前节点访问另一个Node节点docker0 IP
如果能通说明Flannel部署成功。如果不通检查下日志:journalctl -u flannel

flanneld v0.10.0 版本部署

原文:http://blog.51cto.com/hequan/2327822

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!