Write in front
Kubernetes is currently the most hot-handed container management, scheduling, orchestration platform, not only has a comprehensive ecosystem, but also open source, open self-government, who contribute more, who the right to speak, the cloud provider has dedicated engineers to engage in kubernetes open source projects, its software upgrade iterations very fast , today we'll talk about how to use Kubeadm to smoothly upgrade kubenetes clusters to v1.10.3.
Note: Kubeadm is a quick tool to build a kubernetes cluster.
View current cluster version
As can be seen from the above, the master node Kubelete version is lower than the Woker node, kubernetes version tilt does not support the situation, the detailed reasons are as follows:
For these two reasons, to avoid some unnecessary problems, we decided to upgrade the cluster immediately.
View Cluster
Check which versions are available for upgrade and verify that the current cluster is upgradeable.
kubeadm upgrade plan [flags]
It is clear that we need to upgrade Kubeadm before we can upgrade control Pannel, and Kubeadm does not automatically install and manage Kubelet, kubectl, so we need to manually complete the upgrade of these three components.
Upgrade Kubeadm Kubelet Kubectl
yum install -y kubelet kubeadm kubectl
Upgrading cluster components
kubeadm upgrade apply v1.10.3
Upgrading the network plug-in
Kubernetes supports all network plug-ins conforming to the specifications of the company, the production environment generally recommends the use of Calico, other network plug-in upgrade you can go to the official website to view.
kubectl apply -f https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/rbac-kdd.yamlkubectl apply -f https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml
View Cluster again
As can be seen from the above, each control pannel and components are successfully upgraded!!!
Note: After the execution of the command, it may be a period of time kubectl get nodes see the version has not changed, dashboard is also in a zombie state, do not worry, wait about 20 minutes or so, but the service will soon recover, the basic user is not aware.
Extended Reading
Https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-upgrade
Https://kubernetes.io/docs/tasks/tools/install-kubeadm
Https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm
Use Kubeadm to smoothly upgrade kubenetes clusters (v1.10.2 to v1.10.3)