linux k8s

Time:2020-11-22

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:

linux k8s

  • 2.3. Configuration: VI / etc / kubernetes / apiserver file. The configuration results are as follows:

linux k8s

  • 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:

linux k8s

  • 3.3 modify: VI / etc / kubernetes / config file, and the configuration results are as follows:

linux k8s

  • 3.4. Modify the kubelet configuration file / etc / kubernetes / kubelet of node machine

linux k8s

  • 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

You’re far from it!

Recommended Today

Regular expression sharing for checking primes

This regular expression is shown as follows: Regular expressions for checking prime numbers or not To use this positive regular expression, you need to convert the natural number into multiple 1 strings. For example, 2 should be written as “11”, 3 should be written as “111”, 17 should be written as “11111111111”. This kind of […]