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,kube-install | 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,kube-install | 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 |
Execute the following command on kube-install host:
# kube-install -exec addnode -node "192.168.1.15,192.168.1.16" -k8sver "1.22" -ostype "centos7" -label "192168001011"
Notice: Please make sure that the -ostype
flag you entered is correct, only support rhel7
, rhel8
, centos7
, centos8
, ubuntu20
, suse15
these types of "ostype".
If you need to specify the directory path to add Kubernetes node, you can set it using the -softdir
parameter.
In addition, you can also add Kubernetes node using the Kube-Install web platform. For the installation process using the web platform, click here to view more details !
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. Execute the following command on kube-install host:
# kube-install -exec delnode -node "192.168.1.13,192.168.1.15" -label "192168001011"
Notice: If you specify the -softdir
parameter value during the installation or addnode operation, please specify the same -softdir
parameter value during the delnode operation.
In addition, you can also delete Kubernetes node using the Kube-Install web platform. For the installation process using the web platform, click here to view more details !
The architecture after installation is shown in the following figure:
You will Delete the k8s-master (192.168.1.13) from the kubernetets cluster. Execute the following command on kube-install host:
# kube-install -exec delmaster -master "192.168.1.13" -label "192168001011"
Notice: If you specify the -softdir
parameter value during the installation operation, please specify the same -softdir
parameter value during the delmaster operation.
In addition, you can also delete Kubernetes master using the Kube-Install web platform. For the installation process using the web platform, click here to view more details !
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. Execute the following command on kube-install host:
# kube-install -exec rebuildmaster -rebuildmaster "192.168.1.13" -k8sver "1.22" -ostype "centos7" -label "192168001011"
Notice: Please make sure that the -ostype
flag you entered is correct, only support rhel7
, rhel8
, centos7
, centos8
, ubuntu20
, suse15
these types of "ostype".
If you specify the -softdir
parameter value during the installation operation, please specify the same -softdir
parameter value during the rebuildmaster operation.
In addition, you can also rebuild Kubernetes master using the Kube-Install web platform. For the installation process using the web platform, click here to view more details !
The architecture after installation is shown in the following figure:
You will uninstall kubernetets cluster. Execute the following command on kube-install host:
# kube-install -exec 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" -label "192168001011"
Notice: If you specify the -softdir
parameter value during the installation operation, please specify the same -softdir
parameter value during the uninstall operation.
In addition, you can also uninstall the Kubernetes cluster using the Kube-Install web platform. For the installation process using the web platform, click here to view more details !