Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method of reinitializing k8s cluster

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "what is the method of reinitialization of K8s cluster". In daily operation, I believe many people have doubts about the method of reinitialization of K8s cluster. The editor consulted all kinds of materials and sorted out simple and useful operation methods. I hope it will be helpful to answer the question of "what is the method of reinitialization of K8s cluster?" Next, please follow the editor to study!

K8s cluster reinitialization

When booting a k8s cluster, you may need to reboot the cluster for one reason or another, assuming that you have already done the following steps:

System kernel settings

The image involved in K8s has been pulled successfully

The network plug-in has been successfully installed

Docker accelerated image has been configured

K8s and docker image private server have been integrated.

The steps to reboot the k8s cluster are as follows:

Master node

1. Execute the following reset command on the master node:

The kubeadm reset# process asks if you want to reset, enter y and enter enter

2. Clear the configuration information manually, which is a key step:

Rm-rf / root/.kuberm-rf / etc/cni/net.dyum install-y ipvsadmipvsadm-Ciptables-F & & iptables-t nat-F & & iptables-t mangle-F & & iptables-X

3. Reboot the cluster

Kubeadm init xxxxx for example, as per yours: kubeadm init-image-repository registry.aliyuncs.com/google_containers-kubernetes-version v1.18.3-pod-network-cidr=192.168.0.0/16-control-plane-endpoint=k8s-control-cluster-endpoint

4. Create a configuration directory and copy the permission configuration file to the user directory:

Mkdir-p $HOME/.kubesudo cp-I / etc/kubernetes/admin.conf $HOME/.kube/configsudo chown $(id-u): $(id-g) $HOME/.kube/config

5. Install the network plug-in

Kubectl apply-f https://docs.projectcalico.org/v3.14/manifests/calico.yamlwork node

1. Reset the work node

Kubeadm reset input y

2. Delete the directory manually

Rm-rf / root/.kuberm-rf / etc/cni/net.drm-rf / etc/kubernetes/*ipvsadm-Ciptables-F & & iptables-t nat-F & & iptables-t mangle-F & & iptables-X

3. Rejoin the cluster

Kubeadm join xxx # can get this instruction by executing it on the master node: kubeadm token create-print-join-command. This is the end of the study on "what is the method of reinitializing the K8s cluster?". I hope to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report