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

How to solve the etcd error of kubernetes High availability Cluster upgrade

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

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "kubernetes high availability cluster upgrade etcd error how to solve", in the daily operation, I believe many people in kubernetes high availability cluster upgrade etcd error how to solve the problem there are doubts, Xiaobian consulted all kinds of information, sorted out simple and easy to use operation methods, hope to answer "kubernetes high availability cluster upgrade etcd error how to solve" doubts help! Next, please follow the small series to learn together!

When upgrading kubernetes high availability cluster created by kubeadm, etcd access error occurs. After manually deleting the error node information in etcd, the upgrade succeeds.

Normally kubernetes upgrade is done using the following command:

sudo kubeadm upgrade plan

Then follow the prompts.

1. Etcd access error occurs

But this time, the line went wrong:

etcd.go:480] Failed to get etcd status

After checking, it is the first node of etcd (one of the masters of kubenetes) that cannot be accessed.

2. Remove nodes from the cluster

Delete this node:

kubectl delete node podc01

Then the problem remains. After checking, the etcd service address of the deleted node is still in the cluster and inaccessible. The upgrade cannot be completed.

According to kubeadm instructions on the web, using kubeadm reset automatically deletes etcd node information.

However, after kubeadm reset, the etcd service address of the deleted node is still in the cluster and inaccessible, and the upgrade cannot be completed.

3. Manually delete etcd node

View and manually delete etcd node information:

alias etcdv3="ETCDCTL_API=3 etcdctl --endpoints=https://[10.1.1.202]:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/peer.crt --key=/etc/kubernetes/pki/etcd/peer.key"

Because etcd commands are longer, let's simplify them with an alias.

Change 10.1.1.202 above to your own available master IP address.

For more etcd instructions, see:

Kubernetes etcd multi-node expansion combat skills

Kubernetes Exploration-Etcd Node and Instance Expansion

Kubernetes etcd data viewing and migration

Kubernetes Quest-etcd status data and its backup

Then, run:

#View members of etcd cluster: etcdv3 member list#Remove inaccessible members of etcd cluster: etcdv3 member remove XXXXXXXX #View members of etcd cluster again: etcdv3 member list

Then, run the Kubernetes upgrade command again:

#Check upgrade status. sudo kubeadm upgrade plan#Upgrade directly to Kubernetes version 1.18.1.#! Mirrors may need to be pre-deployed on all nodes. sudo kubeadm upgrade apply v1.18.2

Upgrade successful.

At this point, the study of "how to solve etcd error of kubernetes high availability cluster upgrade" is over, hoping to solve everyone's doubts. Theory and practice can better match to help you learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

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