K8S升级V1.14.0

云计算

1、查看该版本的容器镜像版本:

十载的东光网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。成都营销网站建设的优势是能够根据用户设备显示端的尺寸不同,自动调整东光建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。成都创新互联从事“东光网站设计”,“东光网站推广”以来,每个客户项目都认真落实执行。

kubeadm config images list
输出如下:

~# kubeadm config images list
k8s.gcr.io/kube-apiserver:v1.14.0
k8s.gcr.io/kube-controller-manager:v1.14.0
k8s.gcr.io/kube-scheduler:v1.14.0
k8s.gcr.io/kube-proxy:v1.14.0
k8s.gcr.io/pause:3.1
k8s.gcr.io/etcd:3.3.10
k8s.gcr.io/coredns:1.3.1 

2、拉取容器镜像

原始的kubernetes镜像文件在gcr上,不能直接下载。下面是阿里云上的资源,所有主机上都执行一下(master和node上都执行该脚本)。

echo 
echo ==========================================================
echo Pull Kubernetes v1.14.0 Images from aliyuncs.com ......
echo ==========================================================
echo 

MY_REGISTRY=registry.cn-hangzhou.aliyuncs.com/openthings

## 拉取镜像
docker pull ${MY_REGISTRY}/k8s-gcr-io-kube-apiserver:v1.14.0
docker pull ${MY_REGISTRY}/k8s-gcr-io-kube-controller-manager:v1.14.0
docker pull ${MY_REGISTRY}/k8s-gcr-io-kube-scheduler:v1.14.0
docker pull ${MY_REGISTRY}/k8s-gcr-io-kube-proxy:v1.14.0
docker pull ${MY_REGISTRY}/k8s-gcr-io-etcd:3.3.10
docker pull ${MY_REGISTRY}/k8s-gcr-io-pause:3.1
docker pull ${MY_REGISTRY}/k8s-gcr-io-coredns:1.3.1

## 添加Tag
docker tag ${MY_REGISTRY}/k8s-gcr-io-kube-apiserver:v1.14.0 k8s.gcr.io/kube-apiserver:v1.14.0
docker tag ${MY_REGISTRY}/k8s-gcr-io-kube-scheduler:v1.14.0 k8s.gcr.io/kube-scheduler:v1.14.0
docker tag ${MY_REGISTRY}/k8s-gcr-io-kube-controller-manager:v1.14.0 k8s.gcr.io/kube-controller-manager:v1.14.0
docker tag ${MY_REGISTRY}/k8s-gcr-io-kube-proxy:v1.14.0 k8s.gcr.io/kube-proxy:v1.14.0
docker tag ${MY_REGISTRY}/k8s-gcr-io-etcd:3.3.10 k8s.gcr.io/etcd:3.3.10
docker tag ${MY_REGISTRY}/k8s-gcr-io-pause:3.1 k8s.gcr.io/pause:3.1
docker tag ${MY_REGISTRY}/k8s-gcr-io-coredns:1.3.1 k8s.gcr.io/coredns:1.3.1

docker rmi ${MY_REGISTRY}/k8s-gcr-io-kube-apiserver:v1.14.0
docker rmi ${MY_REGISTRY}/k8s-gcr-io-kube-controller-manager:v1.14.0
docker rmi ${MY_REGISTRY}/k8s-gcr-io-kube-scheduler:v1.14.0
docker rmi ${MY_REGISTRY}/k8s-gcr-io-kube-proxy:v1.14.0
docker rmi ${MY_REGISTRY}/k8s-gcr-io-etcd:3.3.10
docker rmi ${MY_REGISTRY}/k8s-gcr-io-pause:3.1
docker rmi ${MY_REGISTRY}/k8s-gcr-io-coredns:1.3.1

echo 
echo ==========================================================
echo Pull Kubernetes v1.14.0 Images FINISHED.
echo into registry.cn-hangzhou.aliyuncs.com/openthings, 
echo ==========================================================
echo 

保存为shell脚本,然后执行。

3、升级Kubernetes集群

先查看一下需要升级的各个组件的版本。
使用kubeadm upgrade plan,输出的版本升级信息如下:

COMPONENT            CURRENT   AVAILABLE
API Server           v1.13.4   v1.14.0
Controller Manager   v1.13.4   v1.14.0
Scheduler            v1.13.4   v1.14.0
Kube Proxy           v1.13.4   v1.14.0
CoreDNS              1.2.6     1.3.1
Etcd                 3.2.24    3.3.10

确保上面的容器镜像已经下载(如果没有提前下载,可能被网络阻隔导致挂起),然后在master上执行升级(我使用的是1个master,2个node的模式。如果是多个master需要在所有master上执行):
kubeadm upgrade -y apply v1.14.0
看到下面信息,就OK了。
[upgrade/successful] SUCCESS! Your cluster was upgraded to v1.14.0. Enjoy!


文章题目:K8S升级V1.14.0
文章出自:http://pwwzsj.com/article/cpggce.html