Skip to content

Commit

Permalink
Merge pull request #13 from zufardhiyaulhaq/v1.21.7
Browse files Browse the repository at this point in the history
upgrade to v1.21.7
  • Loading branch information
zufardhiyaulhaq committed Nov 30, 2021
2 parents 9a47970 + 1e2610d commit 25a3777
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Kubernetes Hard Way Ansible
Ansible template to create kubernetes cluster with the following specs:
* Kubernetes v1.20.12
* Kubernetes v1.21.7
* Flannel v0.15.1
* CNI v1.0.1
* CRI v1.20.0
* CRI v1.21.0
* runc v1.0.2
* containerd v1.5.8
* gvisor 20211122
Expand Down
4 changes: 2 additions & 2 deletions group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ kubernetes:
### add IP or domain with comma separated
additionalIP: "172.16.0.1,172.16.0.2,kubernetes.zufar.io"
cri:
version: v1.20.0
version: v1.21.0
cni:
version: v1.0.1
etcd:
Expand Down Expand Up @@ -78,7 +78,7 @@ kubernetes:
directory: /home/vagrant/kubernetes-certificate
### number of Kubernetes master
masterNumber: 3
version: v1.20.12
version: v1.21.7

### Infrastructure configuration
infrastructure:
Expand Down
38 changes: 38 additions & 0 deletions upgrade-kubernetes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# Upgrade Kubernetes

### Upgrade from v1.20.12 to v1.21.7

#### Upgrade step
* SSH to deployer node
```bash
ssh [email protected]
```

* Go to `kubernetes-hardway-ansible` directory, checkout to master
```
git fetch --all
git checkout --track origin/v1.21.7
```

* Adjust variable in the group_vars
```
vi group_vars/all.yml
```

* Adjust Kubernetes host and nodes
```
vi hosts/hosts
```

* Run ansible
```
ansible-playbook upgrade-kubernetes.yml -i hosts/hosts
```

* Verify version
```
kubectl version
kubectl get nodes
kubectl describe deployment coredns --namespace kube-system | grep Image
kubectl get daemonset kube-flannel-ds --namespace kube-system -o=jsonpath='{$.spec.template.spec.containers[:1].image}'
```

### Upgrade from v1.19.10 to 1.20.12

Please note that upgrading from v1.19.10 to v1.20.12 will also upgrade flannel, coredns, and metrics-server. Please test in staging or testing cluster before upgrading.
Expand Down
1 change: 1 addition & 0 deletions upgrade-kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
##############################

- name: Cordon kubernetes worker
become: yes
hosts: master
roles:
- upgrade-kubernetes-cordon
Expand Down

0 comments on commit 25a3777

Please sign in to comment.