您好,登錄后才能下訂單哦!
這篇文章主要講解了“flannel集群安裝方法”,文中的講解內容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“flannel集群安裝方法”吧!
1、下載部署flannel
創建目錄(三臺操作)
mkdir -p /app/kubernetes/{cfg,bin,ssl}
tar zxvf flannel-v0.10.0-linux-amd64.tar.gz
cp flanneld mk-docker-opts.sh /app/kubernetes/bin/
scp /app/kubernetes/bin/* k8s-node01:/app/kubernetes/bin/
scp /app/kubernetes/bin/* k8s-node02:/app/kubernetes/bin/
k8s-master-01上執行執行
cd /app/etcd/ssl
/app/etcd/bin/etcdctl --ca-file=ca.pem --cert-file=server.pem --key-file=server-key.pem --endpoints="https://192.168.159.121:2379,https://192.168.159.122:2379,https://192.168.159.123:2379" set /coreos.com/network/config '{"Network": "172.18.0.0/16","Backend":{"Type":"vxlan"}}'
2、三臺部署flannel服務
配置flannel
vi /app/kubernetes/cfg/flanneld
FLANNEL_OPTIONS="--etcd-endpoints=https://192.168.159.121:2379,https://192.168.159.122:2379,https://192.168.159.123:2379 -etcd-cafile=/app/etcd/ssl/ca.pem -etcd-certfile=/app/etcd/ssl/server.pem -etcd-keyfile=/app/etcd/ssl/server-key.pem"
配置flannel自動啟動腳本
vi /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=/app/kubernetes/cfg/flanneld
ExecStart=/app/kubernetes/bin/flanneld --ip-masq $FLANNEL_OPTIONS
ExecStartPost=/app/kubernetes/bin/mk-docker-opts.sh -k DOCKER_NETWORK_OPTIONS -d /run/flannel/subnet.env
Restart=on-failure
[Install]
WantedBy=multi-user.target
配置docker采用flannel網絡
vi /usr/lib/systemd/system/docker.service
EnvironmentFile=/run/flannel/subnet.env
ExecStart=/usr/bin/dockerd \$DOCKER_NETWORK_OPTIONS
啟動服務
systemctl daemon-reload
systemctl restart flanneld
systemctl enable flanneld
systemctl status flanneld
systemctl restart docker
systemctl status docker
感謝各位的閱讀,以上就是“flannel集群安裝方法”的內容了,經過本文的學習后,相信大家對flannel集群安裝方法這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關知識點的文章,歡迎關注!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。