Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation method of flannel Cluster

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains the "flannel cluster installation method". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian slowly and deeply to study and learn the "flannel cluster installation method" together.

1. Download and deploy flannel

Create a catalog (three operations)

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, three deployment flannel service

Configure 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"

Configure Flannel AutoStart script

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

Configure docker to use flannel network

vi /usr/lib/systemd/system/docker.service

EnvironmentFile=/run/flannel/subnet.env

ExecStart=/usr/bin/dockerd \$DOCKER_NETWORK_OPTIONS

start the service

systemctl daemon-reload

systemctl restart flanneld

systemctl enable flanneld

systemctl status flanneld

systemctl restart docker

systemctl status docker

Thank you for reading, the above is the content of the "flannel cluster installation method", after the study of this article, I believe that everyone has a deeper understanding of the flannel cluster installation method, and the specific use needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report