码迷,mamicode.com
首页 > Web开发 > 详细

Kubernetes_V1.10集群部署-master-部署flanne网络

时间:2018-07-05 15:56:19      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:env   master   2.3   int   emctl   etcd   point   flannel   启动   

1.

etcdctl --ca-file=/etc/etcd/ssl/ca.pem --cert-file=/etc/etcd/ssl/server.pem --key-file=/etc/etcd/ssl/server-key.pem --endpoints="https://172.18.6.39:2379,https://172.18.6.40:2379,https://172.18.6.41:2379" set /coreos.com/network/config { "Network": "172.31.0.0/16", "Backend": {"Type": "vxlan"}}

2.生成flannel启动文件

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

[Service]
Type=notify
EnvironmentFile=/etc/kubernetes/flanneld
ExecStart=/usr/bin/flanneld --ip-masq \$FLANNEL_OPTIONS
ExecStartPost=/usr/bin/mk-docker-opts.sh -k DOCKER_NETWORK_OPTIONS -d /run/flannel/subnet.env
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF

3.生成flannel配置文件

cat >/etc/kubernetes/flanneld<<EOF
FLANNEL_OPTIONS="--etcd-endpoints=https://172.18.6.39:2379,https://172.18.6.40:2379,https://172.18.6.41:2379 -etcd-cafile=/etc/etcd/ssl/ca.pem -etcd-certfile=/etc/etcd/ssl/server.pem -etcd-keyfile=/etc/etcd/ssl/server-key.pem"
EOF

4.启动flannel

 

5.修改docker配置文件

(1)修改启动文件

vim /usr/lib/systemd/system/docker.service
#Add envionment#
EnvironmentFile=/run/flannel/subnet.env #添加
ExecStart=/usr/bin/dockerd --graph=/opt/docker $DOCKER_NETWORK_OPTIONS #修改

(2)修改配置文件

cd /etc/docker/
cp daemon.json daemon.json_bak

systemctl daemon-reload
systemctl restart docker

 

Kubernetes_V1.10集群部署-master-部署flanne网络

标签:env   master   2.3   int   emctl   etcd   point   flannel   启动   

原文地址:https://www.cnblogs.com/dingkailinux/p/9268436.html

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