当前位置:网站首页>Upgrade kubernetes 1.23.2 to 1.24.1
Upgrade kubernetes 1.23.2 to 1.24.1
2022-07-19 02:49:00 【Lao Duan studio】
The earlier runtime How to make use of docker Migrate to containerd,k8s 1.24 An important change from the previous version is that it has been abandoned dockershim 了 , So how can we 1.23.2 Upgrade to 1.24.1.
1. preparation
Modify the parameters of two nodes , The following steps should be in runtime After the migration .
[[email protected] ~]# kubectl edit nodes vms61.rhce.cc
hold
apiVersion: v1
kind: Node
metadata:
annotations:
kubeadm.alpha.kubernetes.io/cri-socket: /var/run/dockershim.sock
It is amended as follows
apiVersion: v1
kind: Node
metadata:
annotations:
kubeadm.alpha.kubernetes.io/cri-socket: /var/run/containerd/containerd.sock
[[email protected] ~]# kubectl edit nodes vms62.rhce.cc
Make similar changes above , Then restart on both machines kubelet
[[email protected] ~]# systemctl restart kubelet
[[email protected] ~]#
If it doesn't change , The following errors will be reported when updating .
[ERROR ImagePull]: failed to pull image registry.aliyuncs.com/google_containers/kube-apiserver:v1.24.1: output:
... Output ... error: exit status 1
2. upgrade master
1. Install first kubeadm1.24.1
[[email protected] ~]# yum install -y kubeadm-1.24.1-0 --disableexcludes=kubernetes
... Output ...
[[email protected] ~]#
2. Vacate the node vms61
[[email protected] ~]# kubectl drain vms61.rhce.cc --ignore-daemonsets
node/vms61.rhce.cc cordoned
WARNING: ignoring DaemonSet-managed Pods: kube-system/calico-node-lf6t2, kube-system/kube-proxy-mhr5g
evicting pod kube-system/coredns-6d8c4cb4d-f2vq4
evicting pod kube-system/calico-kube-controllers-78d6f96c7b-wfx5b
evicting pod kube-system/coredns-6d8c4cb4d-clll2
pod/calico-kube-controllers-78d6f96c7b-wfx5b evicted
pod/coredns-6d8c4cb4d-clll2 evicted
pod/coredns-6d8c4cb4d-f2vq4 evicted
node/vms61.rhce.cc drained
[[email protected] ~]#
3. Upgrade the components of the control node
[[email protected] ~]# kubeadm upgrade apply v1.24.1
... Output ..
[upgrade/successful] SUCCESS! Your cluster was upgraded to "v1.24.1". Enjoy!
[upgrade/kubelet] Now that your control plane is upgraded, please proceed with upgrading your kubelets if you haven't already done so.
[[email protected] ~]#
4. upgrade kubelet and kubectl To 1.24.1
[[email protected] ~]# yum install -y kubelet-1.24.1-0 kubectl-1.24.1-0 --disableexcludes=kubernetes
[[email protected] ~]#
modify kubelet Parameters
from
[[email protected] ~]# cat /var/lib/kubelet/kubeadm-flags.env
KUBELET_KUBEADM_ARGS="--network-plugin=cni --pod-infra-container-image=registry.aliyuncs.com/google_containers/pause:3.5"
[[email protected] ~]#
Change it to
[[email protected] ~]# cat /var/lib/kubelet/kubeadm-flags.env
KUBELET_KUBEADM_ARGS="--pod-infra-container-image=registry.aliyuncs.com/google_containers/pause:3.5"
[[email protected] ~]#
That is, the parameter... Is deleted here –network-plugin=cni, If this parameter is not deleted kubelet It won't start .
5. restart kubelet
[[email protected] ~]# systemctl daemon-reload; systemctl restart kubelet
[[email protected] ~]#
6. Yes vms61 perform uncordon
[[email protected] ~]# kubectl uncordon vms61.rhce.cc
node/vms61.rhce.cc uncordoned
[[email protected] ~]#
View node status .
[[email protected] ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
vms61.rhce.cc Ready control-plane 235d v1.24.1
vms62.rhce.cc Ready <none> 235d v1.23.2
[[email protected] ~]#
2. upgrade worker
1. stay worker Installation on kubeadm v1.24.1.
[[email protected] ~]# yum install -y kubeadm-1.24.1-0 --disableexcludes=kubernetes
[[email protected] ~]#
stay master(vms61) Empty node vms62
[[email protected] ~]# kubectl drain vms62.rhce.cc --ignore-daemonsets
node/vms62.rhce.cc cordoned
WARNING: ignoring DaemonSet-managed Pods: kube-system/calico-node-hth7g, kube-system/kube-proxy-zdhtx
evicting pod kube-system/coredns-6d8c4cb4d-rzqfm
evicting pod default/web1-665f6b46cb-jgzp8
evicting pod kube-system/calico-kube-controllers-78d6f96c7b-8nfvs
evicting pod kube-system/coredns-6d8c4cb4d-mnjwm
evicting pod default/web1-665f6b46cb-fl9b4
pod/web1-665f6b46cb-jgzp8 evicted
pod/web1-665f6b46cb-fl9b4 evicted
pod/calico-kube-controllers-78d6f96c7b-8nfvs evicted
pod/coredns-6d8c4cb4d-rzqfm evicted
pod/coredns-6d8c4cb4d-mnjwm evicted
node/vms62.rhce.cc drained
[[email protected] ~]#
2. Switch to vms62 Upgrade on kubelet To configure
[[email protected] ~]# kubeadm upgrade node
[upgrade] Reading configuration from the cluster...
[upgrade] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[preflight] Running pre-flight checks
[preflight] Skipping prepull. Not a control plane node.
[upgrade] Skipping phase. Not a control plane node.
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[upgrade] The configuration for this node was successfully updated!
[upgrade] Now you should go ahead and upgrade the kubelet package using your package manager.
[[email protected] ~]#
modify kubelet The variable file , from
[[email protected] ~]# cat /var/lib/kubelet/kubeadm-flags.env
KUBELET_KUBEADM_ARGS="--network-plugin=cni --pod-infra-container-image=registry.aliyuncs.com/google_containers/pause:3.5"
[[email protected] ~]#
Change it to
[[email protected] ~]# cat /var/lib/kubelet/kubeadm-flags.env
KUBELET_KUBEADM_ARGS="--pod-infra-container-image=registry.aliyuncs.com/google_containers/pause:3.5"
[[email protected] ~]#
That is, the parameter... Is deleted here –network-plugin=cni .
3. upgrade kubelet and kubectl
[[email protected] ~]# yum install -y kubelet-1.24.1-0 kubectl-1.24.1-0 --disableexcludes=kubernetes
[[email protected] ~]#
4. restart kubelet
[[email protected] ~]# systemctl daemon-reload; systemctl restart kubelet
5. Release right vms62 The protection of the
Switch to vms61 Yes vms62 perform uncordon operation
[[email protected] ~]# kubectl uncordon vms62.rhce.cc
node/vms62.rhce.cc uncordoned
[[email protected] ~]#
3. verification
View node status
[[email protected] ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
vms61.rhce.cc Ready control-plane 235d v1.24.1
vms62.rhce.cc Ready <none> 235d v1.24.1
[[email protected] ~]#
see pod
[[email protected] ~]# kubectl get pods
NAME READY STATUS RESTARTS AGE
web1-665f6b46cb-g9kcl 1/1 Running 0 4m46s
web1-665f6b46cb-q8db5 1/1 Running 0 4m47s
[[email protected] ~]#
边栏推荐
- Dynamic programming - 01 knapsack problem
- Use of sqlmap
- expect免交互
- Getting to know Alibaba cloud environment construction for the first time: unable to connect remotely, and having been in the pit: the server Ping fails, FTP is built, the server builds the database,
- Shell script integer value comparison, logic test, if statement, extract performance monitoring indicators
- Chapter 1 - multi agent system
- The JMeter BeanShell implementation writes the parameterized data generated by the request to the file
- 升级kubernetes 1.23.2到1.24.1
- TCP的三次握手与四次断开
- MySQL初探
猜你喜欢
![[unity Editor Extension] find all objects of a script attached in the scene and resources](/img/c2/ea07a227535755945100dc80a43658.png)
[unity Editor Extension] find all objects of a script attached in the scene and resources

RHCE8学习指南 第4章 获取帮助

RHCE-ansible第二次作业

单片机之数码管秒表的动态显示

Squid agent service deployment

使用gatekeeper限制kubernetes创建特定类型的资源

Win10 下OneDrive 失效重装

squid代理服务部署

An example of C language callback function & sprinf practical application

SSH Remote Control and access
随机推荐
Flask template injection
Dynamic programming problem - Small Soldiers rush forward
module_init函数底层原理
Redisson实现分布式锁的实战案例-锁单key-锁多key-看门狗
FTP service
Chapter 1 - multi agent system
Squid agent service deployment
[unity Editor Extension] find all objects of a script attached in the scene and resources
WINRAR命令拷贝指定文件夹为压缩文件,调用计划任务进行备份。
微信小程序
RHCE8学习指南 第7章 服务管理
Services for NFS
Lintcode 366:fibonacci Fibonacci sequence
Uniapp wechat applet login (authorize wechat first and then mobile phone number) - (1)
High quality subroutine
Convert string to integer
Regular and extended expressions, sed text processor and awk tool, changing IP address with script
Dirty reading, unreal reading, non repeatable reading
Flyway's SaaS multi tenant implementation scheme
Let's learn about awk~