@@ -9,7 +9,7 @@ weight: 100
9
9
This page explains how to upgrade a Linux Worker Nodes created with kubeadm.
10
10
11
11
## {{% heading "prerequisites" %}}
12
-
12
+
13
13
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
14
14
* Familiarize yourself with [ the process for upgrading the rest of your kubeadm
15
15
cluster] ( /docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade ) . You will want to
@@ -21,80 +21,79 @@ upgrade the control plane nodes before upgrading your Linux Worker nodes.
21
21
22
22
### Upgrade kubeadm
23
23
24
- Upgrade kubeadm:
25
-
26
- {{< tabs name="k8s_install_kubeadm_worker_nodes" >}}
27
- {{% tab name="Ubuntu, Debian or HypriotOS" %}}
28
- ``` shell
29
- # replace x in {{< skew currentVersion >}}.x-00 with the latest patch version
30
- apt-mark unhold kubeadm && \
31
- apt-get update && apt-get install -y kubeadm={{< skew currentVersion > }}.x-00 && \
32
- apt-mark hold kubeadm
33
- ```
34
- {{% /tab %}}
35
- {{% tab name="CentOS, RHEL or Fedora" %}}
36
- ``` shell
37
- # replace x in {{< skew currentVersion >}}.x-0 with the latest patch version
38
- yum install -y kubeadm-{{< skew currentVersion > }}.x-0 --disableexcludes=kubernetes
39
- ```
40
- {{% /tab %}}
41
- {{< /tabs >}}
24
+ Upgrade kubeadm:
25
+
26
+ {{< tabs name="k8s_install_kubeadm_worker_nodes" >}}
27
+ {{% tab name="Ubuntu, Debian or HypriotOS" %}}
28
+ ``` shell
29
+ # replace x in {{< skew currentVersion >}}.x-00 with the latest patch version
30
+ apt-mark unhold kubeadm && \
31
+ apt-get update && apt-get install -y kubeadm={{< skew currentVersion > }}.x-00 && \
32
+ apt-mark hold kubeadm
33
+ ```
34
+ {{% /tab %}}
35
+ {{% tab name="CentOS, RHEL or Fedora" %}}
36
+ ``` shell
37
+ # replace x in {{< skew currentVersion >}}.x-0 with the latest patch version
38
+ yum install -y kubeadm-{{< skew currentVersion > }}.x-0 --disableexcludes=kubernetes
39
+ ```
40
+ {{% /tab %}}
41
+ {{< /tabs >}}
42
42
43
43
### Call "kubeadm upgrade"
44
44
45
- - For worker nodes this upgrades the local kubelet configuration:
45
+ For worker nodes this upgrades the local kubelet configuration:
46
46
47
- ``` shell
48
- sudo kubeadm upgrade node
49
- ```
47
+ ``` shell
48
+ sudo kubeadm upgrade node
49
+ ```
50
50
51
51
### Drain the node
52
52
53
- - Prepare the node for maintenance by marking it unschedulable and evicting the workloads:
53
+ Prepare the node for maintenance by marking it unschedulable and evicting the workloads:
54
54
55
- ``` shell
56
- # replace <node-to-drain> with the name of your node you are draining
57
- kubectl drain < node-to-drain> --ignore-daemonsets
58
- ```
55
+ ``` shell
56
+ # replace <node-to-drain> with the name of your node you are draining
57
+ kubectl drain < node-to-drain> --ignore-daemonsets
58
+ ```
59
59
60
60
### Upgrade kubelet and kubectl
61
61
62
- - Upgrade the kubelet and kubectl:
63
-
64
- {{< tabs name="k8s_kubelet_and_kubectl" >}}
65
- {{% tab name="Ubuntu, Debian or HypriotOS" %}}
66
- ``` shell
67
- # replace x in {{< skew currentVersion >}}.x-00 with the latest patch version
68
- apt-mark unhold kubelet kubectl && \
69
- apt-get update && apt-get install -y kubelet={{< skew currentVersion > }}.x-00 kubectl={{< skew currentVersion > }}.x-00 && \
70
- apt-mark hold kubelet kubectl
71
- ```
72
- {{% /tab %}}
73
- {{% tab name="CentOS, RHEL or Fedora" %}}
74
- ``` shell
75
- # replace x in {{< skew currentVersion >}}.x-0 with the latest patch version
76
- yum install -y kubelet-{{< skew currentVersion > }}.x-0 kubectl-{{< skew currentVersion > }}.x-0 --disableexcludes=kubernetes
77
- ```
78
- {{% /tab %}}
79
- {{< /tabs >}}
80
- <br />
81
-
82
- - Restart the kubelet:
83
-
84
- ``` shell
85
- sudo systemctl daemon-reload
86
- sudo systemctl restart kubelet
87
- ```
62
+ 1 . Upgrade the kubelet and kubectl:
63
+
64
+ {{< tabs name="k8s_kubelet_and_kubectl" >}}
65
+ {{% tab name="Ubuntu, Debian or HypriotOS" %}}
66
+ ``` shell
67
+ # replace x in {{< skew currentVersion >}}.x-00 with the latest patch version
68
+ apt-mark unhold kubelet kubectl && \
69
+ apt-get update && apt-get install -y kubelet={{< skew currentVersion > }}.x-00 kubectl={{< skew currentVersion > }}.x-00 && \
70
+ apt-mark hold kubelet kubectl
71
+ ```
72
+ {{% /tab %}}
73
+ {{% tab name="CentOS, RHEL or Fedora" %}}
74
+ ``` shell
75
+ # replace x in {{< skew currentVersion >}}.x-0 with the latest patch version
76
+ yum install -y kubelet-{{< skew currentVersion > }}.x-0 kubectl-{{< skew currentVersion > }}.x-0 --disableexcludes=kubernetes
77
+ ```
78
+ {{% /tab %}}
79
+ {{< /tabs >}}
80
+
81
+ 1 . Restart the kubelet:
82
+
83
+ ``` shell
84
+ sudo systemctl daemon-reload
85
+ sudo systemctl restart kubelet
86
+ ```
88
87
89
88
### Uncordon the node
90
89
91
- - Bring the node back online by marking it schedulable:
90
+ Bring the node back online by marking it schedulable:
92
91
93
- ``` shell
94
- # replace <node-to-uncordon> with the name of your node
95
- kubectl uncordon < node-to-uncordon>
96
- ```
92
+ ``` shell
93
+ # replace <node-to-uncordon> with the name of your node
94
+ kubectl uncordon < node-to-uncordon>
95
+ ```
97
96
98
- ## {{% heading "whatsnext" %}}
97
+ ## {{% heading "whatsnext" %}}
99
98
100
99
* See how to [ Upgrade Windows nodes] ( /docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes/ ) .
0 commit comments