Deployment environment:
CentOS Linux Release 7.2 64-bit
10.10.0.103 node01
10.10.0.49 NODE02
Installation process:
# Yum Install flannel
# tar zxf flannel-v0.8.0-linux-amd64_.tar.gz
# CP flanneld/usr/bin/
# CP mk-docker-opts.sh/usr/bin/
To edit a service configuration file:
#cat/usr/lib/systemd/system/flanneld.service [Unit]description=flanneld overlay address Etcd agentafter= network.targetbefore=docker.service[service]type=notifyenvironmentfile=/etc/sysconfig/flannelexecstart=/usr/ BIN/FLANNELD-ETCD-ENDPOINTS=${FLANNEL_ETCD} $FLANNEL _options[install]requiredby=docker.servicewantedby= Multi-user.target
To edit a configuration file:
#cat/etc/sysconfig/flannel flannel_etcd= "http://10.10.0.103:2379,http://10.10.0.49:2379" flannel_etcd_key= "/ Coreos.com/network "
Add a network configuration information in the ETCD Library, flannel to allocate the virtual IP address segment for Docker:
# Etcdctl Set/coreos.com/network/config
# Etcdctl Get/coreos.com/network/config
{"Network": "10.1.0.0/16"}
# Systemctl Start Flanneld
# mk-docker-ops.sh-i
# source/run/flannel/subnet.env
# ifconfig Docker0 ${flannel_subment}
#ifconfig View Docker network card IP
docker0: flags=4163<up,broadcast,running,multicast> mtu 1500 inet 10.1.8.1 netmask 255.255.255.0 broadcast 10.1.8.255 ether 02:42:bf:cb:f1:ff txqueuelen 0 (Ethernet) RX packets 40369 bytes 8671191 (8.2&NBSP;MIB) rx errors 0 dropped 0 overruns 0 frame 0 TX packets 40663 bytes 3818695 (3.6 MiB) TX errors 0 dropped 0 Overruns 0 carrier 0 collisions 0eth0: flags=4163<up,broadcast, running,multicast> mtu 1500 inet 10.10.0.103 netmask 255.255.0.0 broadcast 10.10.255.255 ether 00:16:3e:0 8:93:f7 txqueuelen 1000 (Ethernet) rx packets 2033352 bytes 695497718 (663.2&NBSP;MIB) RX errors 0 dropped 0 overruns 0 Frame 0 tx packets 1378035 bytes 2166169069 (2.0 gib) tx errors 0 dropped 0 overruns 0 carrier 0 collisions 0flannel0 : flags=4305<up,pointopoint,running,noarp,multicast> mtu 1472 inet 10.1.8.0 netmask 255.255.0.0 destination 10.1.8.0 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC) rx packets 6 bytes 504 (504.0 b) rx errors 0 dropped 0 overruns 0 frame 0 TX packets 6 bytes 504 (504.0 b) TX errors 0 dropped 0 overruns 0 Carrier 0 collisions 0
The other node also repeats the above installation steps.
This article is from the "Zhaohaihua _ Yun-dimensional Road" blog, please be sure to keep this source http://baiying.blog.51cto.com/1068039/1967156
Kubernetes Cluster Network configuration Scenario--flannel deployment