1. Upgrade kubeadm
- Check current version of kubeadm:
cloud_user@ip-10-0-1-101:~$ sudo kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.2", GitCommit:"17c77c7898218073f14c8d573582e8d2313dc740", GitTreeState:"clean", BuildDate:"2018-10-24T06:51:33Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
- Check current version of kubelet:
cloud_user@ip-10-0-1-101:~$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
ip-10-0-1-101 Ready master 18m v1.12.2
ip-10-0-1-102 Ready <none> 17m v1.12.2
ip-10-0-1-103 Ready <none> 17m v1.12.2
cloud_user@ip-10-0-1-101:~$
- Check current version of kubectl & api-server:
cloud_user@ip-10-0-1-101:~$ kubectl version --short
Client Version: v1.12.2
Server Version: v1.12.10
cloud_user@ip-10-0-1-101:~$
- Create two new variables:
export VERSION=v1.13.5
export ARCH=amd64
- Get the newer version of kubeadm:
curl -sSL https://dl.k8s.io/release/${VERSION}/bin/linux/${ARCH}/kubeadm > kubeadm
- Install the newer version of kubeadm:
sudo install -o root -g root -m 0755 ./kubeadm /usr/bin/kubeadm
- Plan the upgrade to check for error:
sudo kubeadm upgrade plan
- Apply the upgrade of the kube-scheduler and kube-controller-manager:
sudo kubeadm upgrade apply v1.13.5
cloud_user@ip-10-0-1-101:~$ kubectl version --short
Client Version: v1.12.2
Server Version: v1.13.5
2. Upgrade The Version of kubelet on the Master Node
- Get the newer version of kubelet:
curl -sSL https://dl.k8s.io/release/${VERSION}/bin/linux/${ARCH}/kubelet > kubelet
- Install the newer version of kubelet:
sudo install -o root -g root -m 0755 ./kubelet /usr/bin/kubelet
sudo systemctl restart kubelet.service
cloud_user@ip-10-0-1-101:~$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
ip-10-0-1-101 Ready master 37m v1.13.5
ip-10-0-1-102 Ready <none> 37m v1.12.2
ip-10-0-1-103 Ready <none> 37m v1.12.2
3. Upgrade The Version of kubelet on the Worker Node
- Create two new variables:
export VERSION=v1.13.5
export ARCH=amd64
- Get the newer version of kubelet:
curl -sSL https://dl.k8s.io/release/${VERSION}/bin/linux/${ARCH}/kubelet > kubelet
- Install the newer version of kubelet:
sudo install -o root -g root -m 0755 ./kubelet /usr/bin/kubelet
sudo systemctl restart kubelet.service
cloud_user@ip-10-0-1-101:~$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
ip-10-0-1-101 Ready master 42m v1.13.5
ip-10-0-1-102 Ready <none> 42m v1.13.5
ip-10-0-1-103 Ready <none> 42m v1.13.5
4. Upgrade kubectl
- Get the new version of kubectl:
curl -sSL https://dl.k8s.io/release/${VERSION}/bin/linux/${ARCH}/kubectl > kubectl
- Install the latest version of kubectl.:
sudo install -o root -g root -m 0755 ./kubectl /usr/bin/kubectl
cloud_user@ip-10-0-1-101:~$ kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.5", GitCommit:"2166946f41b36dea2c4626f90a77706f426cdea2", GitTreeState:"clean", BuildDate:"2019-03-25T15:26:52Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.5", GitCommit:"2166946f41b36dea2c4626f90a77706f426cdea2", GitTreeState:"clean", BuildDate:"2019-03-25T15:19:22Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
cloud_user@ip-10-0-1-101:~$ kubectl version --short
Client Version: v1.13.5
Server Version: v1.13.5