1. Execute the following command on all machines to prepare the installation environment: (note that all machines, master and slave nodes should be installed)
- 1.1. Install the EPEL release source
yum -y install epel-release
- 1.2 turn off the firewall for all machines
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
#View firewall status
firewall-cmd --state
2. Now start installing kubernetes master on 192.168.26.227 on the master host
- 2.1. Use Yum to install etcd and kubernetes master
yum -y install etcd kubernetes-master
- 2.2 editor: VI / etc / etcd/ etcd.conf The results are as follows:
- 2.3. Configuration: VI / etc / kubernetes / apiserver file. The configuration results are as follows:
- 2.4. Start etcd, Kube apiserver, Kube controller manager, Kube scheduler and other services, and set boot up.
for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler; do systemctl restart $SERVICES;systemctl enable $SERVICES;systemctl status $SERVICES ; done
- 2.5 define flannel network in etcd
etcdctl mk /atomic.io/network/config '{"Network":"172.17.0.0/16"}'
3. Next, install the node from the configuration on the machine
- 3.1. Install kubernetes node and flannel component application on node 192.168.26.228
yum -y install flannel kubernetes-node
- 3.2. Specify etcd service for flannel network and modify / etc / sysconfig / FLANNEL file. The configuration results are as follows:
- 3.3 modify: VI / etc / kubernetes / config file, and the configuration results are as follows:
- 3.4. Modify the kubelet configuration file / etc / kubernetes / kubelet of node machine
- 3.5. Start the Kube proxy, kubelet, docker, flanneld and other services on the node machine, and set the boot up.
for SERVICES in kube-proxy kubelet docker flanneld;do systemctl restart $SERVICES;systemctl enable $SERVICES;systemctl status $SERVICES; done
- Execute the following command on 192.168.26.227 on the master host to view the running node machine:
kubectl get nodes
This work adoptsCC agreementThe author and the link to this article must be indicated in the reprint