Docker Management Artifact-kubernetes-flannel Network chapter

Source: Internet
Author: User
Tags etcd

Direct start:

5.1, Flannel Introduction

Flannel is an overlay networking (overlay network) tool designed by the CoreOS team for Kubernetes to help each kuberentes host with CoreOS have a complete subnet. Kubernetes assigns a separate IP address to each pod, which makes it easier for Containers in the same pod to connect to each other, and flannel to set a subnet for the host by creating an overlay grid network (overlay mesh networks) in the cluster 。

5.2. Etcd setting

5.2.1, setting up Fannel network segment

# Etcdctl Set/coreos.com/network/config ' {"Network": "10.2.0.0/16"} '

5.2.2, modifying configuration files

Change the etcd_listen_client_urls= in the/etc/etcd/etcd.conf "Http://localhost:2379″ in the Locahost to 0.0.0.0

5.3. Flannel installation configuration (all node nodes need to be installed)

5.3.1, wget https://github.com/coreos/flannel/releases/download/v0.5.5/flannel-0.5.5-linux-amd64.tar.gz

5.3.2, TAR-XZVF flannel-0.5.5-linux-amd64.tar.gz

5.3.3, installation

Directly copy the extracted two files to the executable directory can be

#cp Flannel-0.5.5/flanneld/usr/bin

#cp Flannel-0.5.5/mk-docker-opts.sh/usr/bin

5.3.4, configuration

Vi/etc/sysconfig/flanneld

Add to:

# Flanneld configuration options

# ETCD URL Location

Flannel_etcd= "http://centos-master:2379"

# ETCS Config key

flannel_etcd_key= "/coreos.com/network"

# any additonal options

#FLANNEL_OPTIONS =

5.3.5, editing service files/usr/lib/systemd/system/flanneld.service

Add to:

[Unit]

Description=flanneld Overlay Address ETCD Agent

After=network.target

Before=docker.service

[Service]

Type=notify

Environmentfile=-/etc/sysconfig/flanneld

Environmentfile=-/etc/sysconfig/docker-network

Execstart=/usr/bin/flanneld \

-ETCD-ENDPOINTS=${FLANNEL_ETCD} \

$FLANNEL _options

[Install]

Requiredby=docker.service

Wantedby=multi-user.target

or start directly:

flanneld-iface=eno16777736-etcd-endpoints= http://centos-master:2379 & (Bind a working NIC)

5.4. Suspension of Docker service

#systemctl Stop Docker

5.6. Execute script (Modify Docker)

#systemctl Start Flanneld

#mk-docker-opts.sh-i

#source/run/flannel/subnet.env

#ifconfig Docker0 ${flannel_subnet}

#systemctl Start Docker

5.7. Testing

On Centos-minion IP A view can see the FLANNEL0 network card information

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/88/89/wKioL1f7UkWB4IOGAAAaxdvvzpI498.png "title=" C4d9dc46-6133-4242-a374-487df5c4b18b.png "alt=" Wkiol1f7ukwb4iogaaaaxdvvzpi498.png "/>




This article is from the "Linux" blog, so be sure to keep this source http://syklinux.blog.51cto.com/9631548/1860301

Docker Management Artifact-kubernetes-flannel Network chapter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.