码迷,mamicode.com
首页 > 其他好文 > 详细

flanneld v0.10.0 版本部署

时间:2018-12-08 23:53:19      阅读:609      评论:0      收藏:0      [点我收藏+]

标签:des   pid   out   usr   amd   app   linux   tps   linu   

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 版本部署

标签:des   pid   out   usr   amd   app   linux   tps   linu   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!