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 quickly upgrade Kubernetes 1.17.4

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

Share

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

This article mainly shows you "Kubernetes 1.17.4 how to quickly upgrade", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "Kubernetes 1.17.4 how to quickly upgrade" this article.

1. Upgrade kubeadm/kubectl/kubelet version sudo apt install kubeadm=1.17.4-00 kubectl=1.17.4-00 kubelet=1.17.4-00

To set up the software source in China, refer to: kubernetes for china

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.17.4k8s.gcr.io/kube-controller-manager:v1.17.4k8s.gcr.io/kube-scheduler:v1.17.4k8s.gcr.io/kube-proxy:v1.17.4k8s.gcr.io/pause:3.1k8s.gcr.io/etcd:3.4.3-0k8s.gcr.io/coredns:1.6.52, 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.17.4 Images from aliyuncs.com." echo "= =" echo "" MY_REGISTRY=registry.cn-hangzhou.aliyuncs.com/openthings## pull image docker pull ${MY_REGISTRY} / k8s-gcr-io-kube-apiserver:v1.17.4docker pull ${MY_REGISTRY} / k8s-gcr-io-kube-controller-manager:v1.17.4docker pull ${MY_REGISTRY} / k8sMugcrashi Scheduler:v1.17.4docker pull ${MY_REGISTRY} / k8s-gcr-io-kube-proxy:v1.17.4docker pull ${MY_REGISTRY} / k8s-gcr-io-etcd:3.4.3-0docker pull ${MY_REGISTRY} / k8s-gcr-io-pause:3.1docker pull ${MY_REGISTRY} / k8s-gcr-io-coredns:1.6.5## add Tagdocker tag ${MY_REGISTRY} / k8s-gcr-io-kube-apiserver:v1.17 .4 k8s.gcr.io/kube-apiserver:v1.17.4docker tag ${MY_REGISTRY} / k8s-gcr-io-kube-scheduler:v1.17.4 k8s.gcr.io/kube-scheduler:v1.17.4docker tag ${MY_REGISTRY} / k8s-gcr-io-kube-controller-manager:v1.17.4 k8s.gcr.io/kube-controller-manager:v1.17.4docker tag ${MY_REGISTRY} / k8s-gcr-io-kube-proxy:v1.17.4 K8s.gcr.io/kube-proxy:v1.17.4docker tag ${MY_REGISTRY} / k8s-gcr-io-etcd:3.4.3-0 k8s.gcr.io/etcd:3.4.3-0docker tag ${MY_REGISTRY} / k8s-gcr-io-pause:3.1 k8s.gcr.io/pause:3.1docker tag ${MY_REGISTRY} / k8s-gcr-io-coredns:1.6.5 k8s.gcr.io/coredns:1.6.5echo "" echo "=" echo "Pull Kubernetes v1.17.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.

Or, download the script: https://github.com/openthings/kubernetes-tools/blob/master/kubeadm/2-images/

3. Upgrade Kubernetes cluster

New installation:

# specify IP address, version 1.17.4: sudo kubeadm init-- kubernetes-version=v1.17.4-- apiserver-advertise-address=10.1.1.199-- pod-network-cidr=10.244.0.0/16

Deploy highly available Kubernetes 1.17.0 using kubeadm

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:

Components that must be upgraded manually after you have upgraded the control plane with 'kubeadm upgrade apply':COMPONENT CURRENT AVAILABLEKubelet 1 x v1.17.2 v1.17.48 x v1.17.2 v1.17.4Upgrade to the latest version in the v1.17 series:COMPONENT CURRENT AVAILABLEAPI Server v1.17.2 v1.17.4Controller Manager v1.17.2 v1.17.4Scheduler v1.17.2 v1.17.4Kube Proxy v1.17.2 v1.17.4CoreDNS 1.6.5 1.6.5Etcd 3.4.3 3.4.3-0You can now apply the upgrade by executing the following command: kubeadm upgrade apply v1.17.4

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 apply v1.17.4

If you see the following message, OK it.

[upgrade/successful] SUCCESS! Your cluster was upgraded to "v1.17.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.

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

View Pod information:

Kubectl get pod-all-namespaces

Done.

⚠️ Note: after version 1.17, if you use kubeadm to install in high availability mode, all master nodes can be upgraded to the latest version (you need to put the container image of K8s on the node in advance).

The above is all the contents of the article "how to upgrade Kubernetes 1.17.4 quickly". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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