Skip to content

Latest commit

 

History

History
144 lines (92 loc) · 6.61 KB

operation0.7.md

File metadata and controls

144 lines (92 loc) · 6.61 KB

Add Node, Delete Node, Rebuild Master, and Uninstall


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 AddressRoleOS VersionRoot Password
192.168.1.11k8s-master,k8s-node,kube-installCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
192.168.1.12k8s-master,k8s-nodeCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
192.168.1.13k8s-master,k8s-nodeCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
192.168.1.14k8s-nodeCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer

The current kubernetes cluster architecture is as follows:

kube-install-arch


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.


Add k8s-node to k8s cluster


You will install two servers (192.168.1.15 and 192.168.1.16) as k8s-node and join the kubernetets cluster.
IP AddressRoleOS VersionRoot Password
192.168.1.11k8s-master,k8s-node,kube-installCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
192.168.1.12k8s-master,k8s-nodeCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
192.168.1.13k8s-master,k8s-nodeCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
192.168.1.14k8s-nodeCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
192.168.1.15k8s-nodeCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
192.168.1.16k8s-nodeCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer

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.

kube-dashboard

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:

kube-install-arch


Delete k8s-node from k8s cluster


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.

kube-dashboard

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:

kube-install-arch


Delete k8s-master from k8s cluster


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:

kube-install-arch


Rebuild k8s-master to k8s cluster


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:

kube-install-arch


Uninstall kubernetes cluster


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.

kube-dashboard

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 !