summaryrefslogtreecommitdiff
path: root/roles/kubernetes/kubeadm/upgrade
blob: dc0a360a752795b6f9f23741d3fd1cdd915147c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Cluster Upgrades:
=================

primary master:
---------------

VERSION=1.20.2

apt-get update
apt-get install -y --allow-change-held-packages "kubeadm=$VERSION-00" && apt-mark hold kubeadm
kubeadm version
kubeadm upgrade plan

kubectl drain $(hostname) --ignore-daemonsets --delete-local-data
kubeadm upgrade apply "v$VERSION"

sed "s/^kubernetesVersion: .*$/kubernetesVersion: $VERSION/" -i /etc/kubernetes/kubeadm.config
apt-get update && apt-get install -y --allow-change-held-packages "kubelet=$VERSION-00" "kubectl=$VERSION-00" && apt-mark hold kubelet kubectl

// security updates + reboot ?

kubectl uncordon $(hostname)


secondary master:
-----------------

VERSION=1.20.2

apt-get update
apt-get install -y --allow-change-held-packages "kubeadm=$VERSION-00" && apt-mark hold kubeadm

kubectl drain $(hostname) --ignore-daemonsets --delete-local-data
kubeadm upgrade node
apt-mark unhold kubelet kubectl && apt-get update && apt-get install -y kubelet="$VERSION-00" "kubectl=$VERSION-00" && apt-mark hold kubelet kubectl

// security updates + reboot ?

kubectl uncordon $(hostname)


worker nodes:
-------------

VERSION=1.20.2

apt-get update
apt-get install -y --allow-change-held-packages "kubeadm=$VERSION-00" && apt-mark hold kubeadm

@primary master: kubectl drain <node> --ignore-daemonsets --delete-local-data

kubeadm upgrade node
apt-mark unhold kubelet kubectl && apt-get update && apt-get install -y kubelet="$VERSION-00" "kubectl=$VERSION-00" && apt-mark hold kubelet kubectl

// security updates + reboot ?

@primary master: kubectl uncordon <node>