Skip to content

Commit 32cdddb

Browse files
committed
[zh] sync upgrading-linux-nodes.md
1 parent 3bd7565 commit 32cdddb

File tree

1 file changed

+59
-60
lines changed

1 file changed

+59
-60
lines changed

content/en/docs/tasks/administer-cluster/kubeadm/upgrading-linux-nodes.md

Lines changed: 59 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ weight: 100
99
This page explains how to upgrade a Linux Worker Nodes created with kubeadm.
1010

1111
## {{% heading "prerequisites" %}}
12-
12+
1313
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
1414
* Familiarize yourself with [the process for upgrading the rest of your kubeadm
1515
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.
2121

2222
### Upgrade kubeadm
2323

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 >}}
4242

4343
### Call "kubeadm upgrade"
4444

45-
- For worker nodes this upgrades the local kubelet configuration:
45+
For worker nodes this upgrades the local kubelet configuration:
4646

47-
```shell
48-
sudo kubeadm upgrade node
49-
```
47+
```shell
48+
sudo kubeadm upgrade node
49+
```
5050

5151
### Drain the node
5252

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:
5454

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+
```
5959

6060
### Upgrade kubelet and kubectl
6161

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+
```
8887

8988
### Uncordon the node
9089

91-
- Bring the node back online by marking it schedulable:
90+
Bring the node back online by marking it schedulable:
9291

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+
```
9796

98-
## {{% heading "whatsnext" %}}
97+
## {{% heading "whatsnext" %}}
9998

10099
* See how to [Upgrade Windows nodes](/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes/).

0 commit comments

Comments
 (0)