1. View the container image version of this version:
kubeadm config images list
The output is as follows:
~# 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. Pull the container image
The original kubernetes image file is on gcr and cannot be downloaded directly. The following are the resources on alicloud. Execute the script on all hosts (master and node).
echo "" echo "==========================================================" echo "Pull Kubernetes v1.14.0 Images from aliyuncs.com ......" echo "==========================================================" echo "" MY_REGISTRY=registry.cn-hangzhou.aliyuncs.com/openthings ## Pull mirror image 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 ## Add 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 ""
Save as a shell script and execute.
3. Upgrade Kubernetes cluster
First, look at the versions of the components that need to be upgraded.
Using the kubeadm upgrade plan, the output version upgrade information is as follows:
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
Make sure that the above container image has been downloaded (if not downloaded in advance, it may be suspended due to network blocking), and then perform the upgrade on the master (I use the mode of 1 master and 2 node s). If multiple masters need to be executed on all Masters):
kubeadm upgrade -y apply v1.14.0
See the following message, OK.
[upgrade/successful] SUCCESS! Your cluster was upgraded to "v1.14.0". Enjoy!