---
# System prepended metadata

title: Kubernetes Upgrade Note (from v1.19-v1.20)

---

# Kubernetes Upgrade Note (from v1.19-v1.20)

## Index
#### This note include step 1 & 2 of all upgrade plan
![](https://i.imgur.com/M2SRGdl.png)
> **1. Upgrade Calico to v3.20**
> **2. Upgrade Kubernetes to v1.20**
> 3. Upgrade Kubernetes to v1.21
> 4. Upgrade Calico to v3.22
> 5. Upgrade Kubernetes to v1.22
> 6. Upgrade Kubernetes to v1.23
> 7. Upgrade Calico to v3.25
> 8. Upgrade Kubernetes to 1.24

<br />

## Upgrade Calico to v3.20
1. pull lastest sportsbook.deployment
2. cd sportsbook.deployment/k8s/on-premise/calico/v3.20
3. add IP_AUTODETECTION_METHOD into calico.yaml
4. run command
> kubectl apply -f calico.yaml
 
reference yaml:
https://docs.projectcalico.org/archive/v3.20/manifests/calico.yaml
reference doc:
https://docs.tigera.io/archive/v3.20/maintenance/kubernetes-upgrade


## Upgrade K8s from 1.19 to 1.20
reference doc:
https://web.archive.org/web/20210925024229/https://v1-20.docs.kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/

### 1. Upgrade kubeadm
> sudo apt-mark unhold kubeadm
> sudo apt-get update
> sudo apt-get install kubeadm=1.20.15-00
> sudo apt-mark hold kubeadm

### 2. Check if any manual upgrade is needed
> kubeadm version
> kubeadm upgrade plan

### 3. Apply your upgrade
**<font color="red">\*Please select which command should be execute base on the node you're upgrading</font>**

##### Fist Control-Plane
> sudo kubeadm upgrade apply v1.20.15

##### Other Control-Plane or Workers
> sudo kubeadm upgrade node
> 
![](https://i.imgur.com/u3JxYSl.png)


### 4. Drain node before update kubelet & kubectl
> kubectl drain <upgrading_node> --ignore-daemonsets

### 5. Upgrade kubelet & kubectl
> sudo apt-mark unhold kubelet kubectl
> sudo apt-get update 
> sudo apt-get install kubelet=1.20.15-00
> sudo apt-get install kubectl=1.20.15-00
> sudo apt-mark hold kubelet kubectl

### 6. Restart daemon
> sudo systemctl daemon-reload
> sudo systemctl restart kubelet

### 7. Uncordon node
> kubectl uncordon <upgrading_node> --ignore-daemonsets
