kubeadm升级k8s集群

1、查看集群版本:

kubeadm升级k8s集群

查看可升级的集群版本

yum list --showduplicates kubeadm --disableexcludes=kubernetes
yum install -y kubeadm-1.16.3-0 --disableexcludes=kubernetes    #所有节点
kubeadm  version

kubeadm升级k8s集群

kubeadm upgrade plan    #查看集群是否可以升级,升级后各组件的版本信息

kubeadm升级k8s集群

2、下载升级的各个镜像<所有节点>

kubeadm config images list | sed -e 's/^/docker pull /g' -e 's#k8s.gcr.io#registry.cn-hangzhou.aliyuncs.com/google_containers#g' | sh -x
docker images | grep registry.cn-hangzhou.aliyuncs.com/google_containers | awk '{print "docker tag",$1":"$2,$1":"$2}' | sed -e 's/registry.cn-hangzhou.aliyuncs.com\/google_containers/k8s.gcr.io/2' | sh -x
docker images | grep registry.cn-hangzhou.aliyuncs.com/google_containers | awk '{print "docker rmi """$1""":"""$2}' | sh -x

kubeadm升级k8s集群

3、升级集群

kubeadm upgrade apply v1.16.3

kubeadm升级k8s集群

master节点进行升级:

kubeadm upgrade node

kubeadm升级k8s集群

升级各个组件

yum install -y kubelet-1.16.3 kubectl-1.16.3 --disableexcludes=kubernetes
systemctl daemon-reload
systemctl restart kubelet

kubeadm升级k8s集群

4、升级worker节点

kubeadm upgrade node
yum install -y kubelet-1.16.3 kubectl-1.16.3 --disableexcludes=kubernetes
systemctl daemon-reload
systemctl restart kubelet

kubeadm升级k8s集群

kubeadm升级k8s集群

上一篇:Docker上传镜像到阿里云Docker镜像仓库


下一篇:Docker本地镜像上传到阿里云仓库