您好,登錄后才能下訂單哦!
1、查看該版本的容器鏡像版本:
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!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。