If you have four servers, kubernetes master software is installed on the three servers (192.168.1.11, 192.168.1.12, 192.168.1.13), and kubernetes node software is installed on the three servers (192.168.1.11, 192.168.1.12, 192.168.1.13, 192.168.1.14).
| IP Address | Role | OS Version | Root Password |
| 192.168.1.11 | k8s-master,k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
| 192.168.1.12 | k8s-master,k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
| 192.168.1.13 | k8s-master,k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
| 192.168.1.14 | k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
The current kubernetes cluster architecture is as follows:
Next, we will carry out daily operation and maintenance operations such as add-k8s node, delete k8s-node, delete k8s-master and rebuild k8s-master.
You will install two servers (192.168.1.15 and 192.168.1.16) as k8s-node and join the kubernetets cluster.
| IP Address | Role | OS Version | Root Password |
| 192.168.1.11 | k8s-master,k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
| 192.168.1.12 | k8s-master,k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
| 192.168.1.13 | k8s-master,k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
| 192.168.1.14 | k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
| 192.168.1.15 | k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
| 192.168.1.16 | k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
Select any k8s-master server, and execute the following command on it:
# kube-install -opt addnode -node "192.168.1.15,192.168.1.16" -sshpwd "cloudnativer" -ostype "centos7"Notice: Please make sure that the -ostype flag you entered is correct, only support rhel7, rhel8, centos7, centos8, suse15 these types of "ostype".
The architecture after installation is shown in the following figure:
You will delete the two k8s-nodes (192.168.1.15 and 192.168.1.16) from the kubernetets cluster. Select any k8s-master server, and execute the following command on it:
# kube-install -opt delnode -node "192.168.1.13,192.168.1.15" -sshpwd "cloudnativer"The architecture after installation is shown in the following figure:
You will Delete the k8s-master (192.168.1.13) from the kubernetets cluster. Select any k8s-master server, and execute the following command on it:
# kube-install -opt delmaster -master "192.168.1.13" -sshpwd "cloudnativer"The architecture after installation is shown in the following figure:
You will rebuild the damaged k8s-master (192.168.1.13) in the kubernetets cluster. Select any k8s-master server, and execute the following command on it:
# kube-install -opt rebuildmaster -rebuildmaster "192.168.1.13" -sshpwd "cloudnativer" -ostype "centos7"Notice: Please make sure that the -ostype flag you entered is correct, only support rhel7, rhel8, centos7, centos8, suse15 these types of "ostype".
The architecture after installation is shown in the following figure:
You will uninstall kubernetets cluster. Select any k8s-master server, and execute the following command on it:
# kube-install -opt uninstall -master "192.168.1.11,192.168.1.12,192.168.1.13" -node "192.168.1.11,192.168.1.12,192.168.1.13,192.168.1.14" -sshpwd "cloudnativer"You can also perform various operations through pre written configuration files. Click here to see more detailed configuration file introduction.




