Kubernetes cluster building (1): environment preparation

Learn about kubernets

This build uses 1 master node, 2 node nodes, and a private docker warehouse

1. Set the IP information of each node

 

2. Set hostname (other nodes also need to be modified)

vi /etc/sysconfig/network
HOSTNAME=master

3. Set the hosts information

[root@k8s-master ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.100.3 k8s-master
192.168.100.5 k8s-node1
192.168.100.4 k8s-node2
192.168.100.6 k8s-docker

4. Turn off the firewall

systemctl stop firewalld
systemctl disable firewalld
systemctl status firewalld

5. After restarting the computer or network, confirm that each node can ping each other

reboot
or
service network restart

5. Install docker on all nodes and set them to start on boot

yum -y install docker
systemctl start docker
systemctl enable docker

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324669627&siteId=291194637