Skip to content

Latest commit

 

History

History
120 lines (78 loc) · 4.48 KB

operation0.4.md

File metadata and controls

120 lines (78 loc) · 4.48 KB

Operation and Maintenance


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-nodeCentOS 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-nodeCentOS 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

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"

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:

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

kube-install-arch


Delete k8s-master from k8s cluster


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:

kube-install-arch


Rebuild k8s-master to k8s cluster


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"

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:

kube-install-arch


Uninstall kubernetes cluster


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"