当前版本:

[root@master ~]# kubectl version
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.5", GitCommit:"c285e781331a3785a7f436042c65c5641ce8a9e9", GitTreeState:"clean", BuildDate:"2022-03-16T15:58:47Z", GoVersion:"go1.17.8", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.5", GitCommit:"c285e781331a3785a7f436042c65c5641ce8a9e9", GitTreeState:"clean", BuildDate:"2022-03-16T15:52:18Z", GoVersion:"go1.17.8", Compiler:"gc", Platform:"linux/amd64"}


最新版本:

[root@master ~]# kubeadm upgrade plan
[upgrade/config] Making sure the configuration is correct:
[upgrade/config] Reading configuration from the cluster...
[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[preflight] Running pre-flight checks.
[upgrade] Running cluster health checks
[upgrade] Fetching available versions to upgrade to
[upgrade/versions] Cluster version: v1.23.5
[upgrade/versions] kubeadm version: v1.23.5
I0505 08:25:00.758979   43844 version.go:255] remote version is much newer: v1.24.0; falling back to: stable-1.23
[upgrade/versions] Target version: v1.23.6
[upgrade/versions] Latest version in the v1.23 series: v1.23.6

Components that must be upgraded manually after you have upgraded the control plane with 'kubeadm upgrade apply':
COMPONENT   CURRENT       TARGET
kubelet     1 x v1.23.1   v1.23.6
            1 x v1.23.4   v1.23.6
            2 x v1.23.5   v1.23.6

Upgrade to the latest version in the v1.23 series:

COMPONENT                 CURRENT   TARGET
kube-apiserver            v1.23.5   v1.23.6
kube-controller-manager   v1.23.5   v1.23.6
kube-scheduler            v1.23.5   v1.23.6
kube-proxy                v1.23.5   v1.23.6
CoreDNS                   v1.8.6    v1.8.6
etcd                      3.5.1-0   3.5.1-0

You can now apply the upgrade by executing the following command:

    kubeadm upgrade apply v1.23.6

Note: Before you can perform this upgrade, you have to update kubeadm to v1.23.6.

_____________________________________________________________________


The table below shows the current state of component configs as understood by this version of kubeadm.
Configs that have a "yes" mark in the "MANUAL UPGRADE REQUIRED" column require manual config upgrade or
resetting to kubeadm defaults before a successful upgrade can be performed. The version to manually
upgrade to is denoted in the "PREFERRED VERSION" column.

API GROUP                 CURRENT VERSION   PREFERRED VERSION   MANUAL UPGRADE REQUIRED
kubeproxy.config.k8s.io   v1alpha1          v1alpha1            no
kubelet.config.k8s.io     v1beta1           v1beta1             no
_____________________________________________________________________


客户端版本:

[root@master ~]# rpm -qa |grep kube
kubectl-1.23.5-0.x86_64
kubeadm-1.23.5-0.x86_64
kubernetes-cni-0.8.7-0.x86_64
kubelet-1.23.5-0.x86_64


卸载老的:

yum remove -y \
kubernetes-cni-* \
kubectl-* \
kubelet-* \
kubeadm-* 

安装1.23.6版本客户端:

[root@master ~]# yum install -y \
kubectl-1.23.6-0.x86_64 \
kubeadm-1.23.6-0.x86_64 \
kubernetes-cni-0.8.7-0.x86_64 \
kubelet-1.23.6-0.x86_64

最新版本:

[root@master ~]# rpm -qa |grep kube
kubectl-1.23.6-0.x86_64
kubeadm-1.23.6-0.x86_64
kubernetes-cni-0.8.7-0.x86_64
kubelet-1.23.6-0.x86_64

拉取镜像,注意coredns的镜像需要tag一下

docker pull registry.aliyuncs.com/google_containers/kube-apiserver:v1.23.6
docker pull registry.aliyuncs.com/google_containers/kube-controller-manager:v1.23.6
docker pull registry.aliyuncs.com/google_containers/kube-scheduler:v1.23.6
docker pull registry.aliyuncs.com/google_containers/kube-proxy:v1.23.6
docker pull registry.aliyuncs.com/google_containers/etcd:3.5.1-0
docker pull registry.aliyuncs.com/google_containers/coredns:1.8.6
docker tag  registry.aliyuncs.com/google_containers/coredns:1.8.6 registry.aliyuncs.com/google_containers/coredns:v1.8.6

升级:

kubeadm upgrade apply v1.23.6

重启:

systemctl daemon-reload
service kubelet restart
kubectl get nodes

当前版本:

[root@master ~]# kubectl version
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.6", GitCommit:"ad3338546da947756e8a88aa6822e9c11e7eac22", GitTreeState:"clean", BuildDate:"2022-04-14T08:49:13Z", GoVersion:"go1.17.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.6", GitCommit:"ad3338546da947756e8a88aa6822e9c11e7eac22", GitTreeState:"clean", BuildDate:"2022-04-14T08:43:11Z", GoVersion:"go1.17.9", Compiler:"gc", Platform:"linux/amd64"}

发表评论

您的电子邮箱地址不会被公开。

Captcha Code