In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "how to upgrade Kubernetes high availability cluster to version 1.13.4". In daily operation, I believe many people have doubts about how to upgrade Kubernetes high availability cluster to version 1.13.4. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "Kubernetes high availability cluster how to upgrade to version 1.13.4". Next, please follow the editor to study!
1. Upgrade the kubeadm/kubectl/kubelet version
Main upgrade, kubeadm/kubectl/kubelet upgrade
Sudo apt install kubeadm=1.13.4-00 kubectl=1.13.4-00 kubelet=1.13.4-00
View the container image version of this version:
Kubeadm config images list
The output is as follows:
~ # kubeadm config images listk8s.gcr.io/kube-apiserver:v1.13.4k8s.gcr.io/kube-controller-manager:v1.13.4k8s.gcr.io/kube-scheduler:v1.13.4k8s.gcr.io/kube-proxy:v1.13.4k8s.gcr.io/pause:3.1k8s.gcr.io/etcd:3.2.24k8s.gcr.io/coredns:1.2.62, pull container image
The original kubernetes image file is on gcr and cannot be downloaded directly. I mirrored it to the container warehouse in Ariyun's Hangzhou computer room, and it was relatively fast to pull it.
Echo "" echo "=" echo "Pull Kubernetes v1.13.3 Images from aliyuncs.com." echo "= =" echo "" MY_REGISTRY=registry.cn-hangzhou.aliyuncs.com/openthings## pulls the image docker pull ${MY_REGISTRY} / k8s-gcr-io-kube-apiserver:v1.13.4docker pull ${MY_REGISTRY} / k8s-gcr-io-kube-controller-manager:v1.13.4docker pull ${MY_REGISTRY} / k8sMugcrashi Scheduler:v1.13.4docker pull ${MY_REGISTRY} / k8s-gcr-io-kube-proxy:v1.13.4docker pull ${MY_REGISTRY} / k8s-gcr-io-etcd:3.2.24docker pull ${MY_REGISTRY} / k8s-gcr-io-pause:3.1docker pull ${MY_REGISTRY} / k8s-gcr-io-coredns:1.2.6## add Tagdocker tag ${MY_REGISTRY} / k8s-gcr-io-kube-apiserver:v1.13.4 K8s.gcr.io/kube-apiserver:v1.13.4docker tag ${MY_REGISTRY} / k8s-gcr-io-kube-scheduler:v1.13.4 k8s.gcr.io/kube-scheduler:v1.13.4docker tag ${MY_REGISTRY} / k8s-gcr-io-kube-controller-manager:v1.13.4 k8s.gcr.io/kube-controller-manager:v1.13.4docker tag ${MY_REGISTRY} / k8s-gcr-io-kube-proxy:v1.13.4 k8s. Gcr.io/kube-proxy:v1.13.4docker tag ${MY_REGISTRY} / k8s-gcr-io-etcd:3.2.24 k8s.gcr.io/etcd:3.2.24docker tag ${MY_REGISTRY} / k8s-gcr-io-pause:3.1 k8s.gcr.io/pause:3.1docker tag ${MY_REGISTRY} / k8s-gcr-io-coredns:1.2.6 k8s.gcr.io/coredns:1.2.6echo "echo" = = "echo" Pull Kubernetes v1.13.4 Images FINISHED. "echo" into registry.cn-hangzhou.aliyuncs.com/openthings "echo" by openthings@ https://my.oschina.net/u/2306127."echo "=" echo ""
Save as a shell script and execute it.
3. Upgrade Kubernetes cluster
New installation:
# specify IP address, version 1.13.4: sudo kubeadm init-- kubernetes-version=v1.13.4-- apiserver-advertise-address=10.1.1.100-- pod-network-cidr=10.244.0.0/16# Note: CoreDNS is built-in, and the parameter-- feature-gates CoreDNS=true is no longer required
First take a look at the versions of the components that need to be upgraded.
Using kubeadm upgrade plan, the version upgrade information is output as follows:
COMPONENT CURRENT AVAILABLEAPI Server v1.13.3 v1.13.4Controller Manager v1.13.3 v1.13.4Scheduler v1.13.3 v1.13.4Kube Proxy v1.13.3 v1.13.4CoreDNS 1.2.6 1.2.6Etcd 3.2.24 3.2.24
Make sure that the above container image has been downloaded (if it is not downloaded in advance, it may be suspended by the network), and then perform the upgrade:
Kubeadm upgrade-y apply v1.13.4
If you see the following message, OK it.
[upgrade/successful] SUCCESS! Your cluster was upgraded to "v1.13.4". Enjoy!
Then, configure the current user environment:
Mkdir-p $HOME/.kube sudo cp-I / etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id-u): $(id-g) $HOME/.kube/config
You can use kubectl version to view the status and kubectl cluster-info to view the service address.
Note:
All nodes pull the latest version of the image in advance, refer to the method above.
The master node upgrade command kubeadm upgrade can be launched from any highly available primary controller.
An etcd error is reported during the upgrade process, because it was modified when the high availability was set, regardless. Currently, kubeadm's upgrade will not change its settings.
4. Upgrade of work node
Each worker node needs to pull the image facing the corresponding version and install the corresponding version of kubelet.
Check the version:
~ $kubectl version
For highly available clusters, you need to modify the version of the image for each node except the upgraded master node.
Open the files under / etc/kubernetes/manifest and change the images version to 1.13.4.
Kube-apiserver.yaml
Kube-controller-manager.yaml
Kube-scheduler.yaml
After saving, the kubelet service will automatically restart the corresponding container instance.
View the node status.
Kubectl get node-o wide
The display status is as follows:
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIMEpodc01 Ready master 75d v1.13.3 10.1.1.201 Ubuntu 18.04.2 LTS 4.15.0-45-generic docker://18.9.3podc02 Ready 69d v1.13.3 10.1.202 Ubuntu 18.04.2 LTS 4.15.0-45-generic docker://18.9.2podc03 Ready 75d v1.13.3 10.1.1.203 Ubuntu 18.04.2 LTS 4.15.0-45-generic docker://18.9.2podc04 Ready 75d v1.13.3 10.1.204 Ubuntu 18.04.2 LTS 4.15.0-45-generic docker://18 .9.3pods01 Ready 73d v1.13.3 10.1.1.193 Ubuntu 18.04.2 LTS 4.15.0-45-generic docker://18.9.2pods02 Ready 70d v1.13.3 10.1.1.234 Ubuntu 18.04.2 LTS 4.15.0-45-generic docker://18.9.2pods03 Ready 70d v1.13.3 10.1.1.205 Ubuntu 18.04.2 LTS 4.15.0-45-generic docker://18.9.3pods04 Ready 70d v1.13.3 10.1.1.112 Ubuntu 18.04.2 LTS 4.15.0-45-generic docker://18.9.2pods05 Ready 13d v1.13.3 10.1.1.150 Ubuntu 18. 04.2 LTS 4.15.0-45-generic docker://18.9.2 to this point The study on "how to upgrade Kubernetes High availability Cluster to version 1.13.4" is over. I hope to be able 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.