@@ -72,16 +72,36 @@ The upgrade workflow at high level is the following:
72
72
<!--
73
73
### Additional information
74
74
75
- - [Draining nodes](/docs/tasks/administer-cluster/safely-drain-node/) before kubelet MINOR version
76
- upgrades is required. In the case of control plane nodes, they could be running CoreDNS Pods or other critical workloads.
75
+ - The instructions below outline when to drain each node during the upgrade process.
76
+ If you are performing a **minor** version upgrade for any kubelet, you **must**
77
+ first drain the node (or nodes) that you are upgrading. In the case of control plane nodes,
78
+ they could be running CoreDNS Pods or other critical workloads. For more information see
79
+ [Draining nodes](/docs/tasks/administer-cluster/safely-drain-node/).
77
80
- All containers are restarted after upgrade, because the container spec hash value is changed.
78
81
-->
82
+
79
83
### 附加信息
80
84
81
- - 在对 kubelet 作次版本升版时需要[ 腾空节点] ( /zh/docs/tasks/administer-cluster/safely-drain-node/ ) 。
82
- 对于控制面节点,其上可能运行着 CoreDNS Pods 或者其它非常重要的负载。
85
+ - 下述说明了在升级过程中何时腾空每个节点。如果你正在对任何 kubelet 进行小版本升级,
86
+ 你需要先腾空待升级的节点(或多个节点)。对于控制面节点,其上可能运行着 CoreDNS Pods
87
+ 或者其它非常重要的负载。更多信息见[ 腾空节点] ( /zh/docs/tasks/administer-cluster/safely-drain-node/ ) 。
83
88
- 升级后,因为容器规约的哈希值已更改,所有容器都会被重新启动。
84
89
90
+ <!--
91
+ - To verify that the kubelet service has successfully restarted after the kubelet has been upgraded,
92
+ you can execute `systemctl status kubelet` or view the service logs with `journalctl -xeu kubelet`.
93
+ - Usage of the `--config` flag of `kubeadm upgrade` with
94
+ [kubeadm configuration API types](/docs/reference/config-api/kubeadm-config.v1beta3)
95
+ with the purpose of reconfiguring the cluster is not recommended and can have unexpected results. Follow the steps in
96
+ [Reconfiguring a kubeadm cluster](/docs/tasks/administer-cluster/kubeadm/kubeadm-reconfigure) instead.
97
+ -->
98
+
99
+ - 要验证 kubelet 服务在升级后是否成功重启,可以执行 ` systemctl status kubelet `
100
+ 或 ` journalctl -xeu kubelet ` 查看服务日志。
101
+ - 不建议使用 ` kubeadm upgrade ` 的 `--config 参数和 [ kubeadm 配置 API 类型] ( /zh/docs/reference/config-api/kubeadm-config.v1beta3 )
102
+ 来重新配置集群,这样会产生意想不到的结果。请按照[ 重新配置 kubeadm 集群] ( /zh/docs/tasks/administer-cluster/kubeadm/kubeadm-reconfigure )
103
+ 中的步骤来进行。
104
+
85
105
<!-- steps -->
86
106
87
107
<!--
@@ -95,19 +115,23 @@ Find the latest patch release for Kubernetes {{< skew currentVersion >}} using t
95
115
96
116
{{< tabs name="k8s_install_versions" >}}
97
117
{{% tab name="Ubuntu、Debian 或 HypriotOS" %}}
98
- ```
118
+
119
+ ``` shell
99
120
apt update
100
121
apt-cache madison kubeadm
101
122
# 在列表中查找最新的 {{< skew currentVersion >}} 版本
102
123
# 它看起来应该是 {{< skew currentVersion >}}.x-00,其中 x 是最新的补丁版本
103
124
```
125
+
104
126
{{% /tab %}}
105
127
{{% tab name="CentOS、RHEL 或 Fedora" %}}
106
- ```
128
+
129
+ ``` shell
107
130
yum list --showduplicates kubeadm --disableexcludes=kubernetes
108
131
# 在列表中查找最新的 {{< skew currentVersion >}} 版本
109
132
# 它看起来应该是 {{< skew currentVersion >}}.x-0,其中 x 是最新的补丁版本
110
133
```
134
+
111
135
{{% /tab %}}
112
136
{{< /tabs >}}
113
137
@@ -140,24 +164,24 @@ Pick a control plane node that you wish to upgrade first. It must have the `/etc
140
164
141
165
{{< tabs name="k8s_install_kubeadm_first_cp" >}}
142
166
{{% tab name="Ubuntu、Debian 或 HypriotOS" %}}
167
+
143
168
``` shell
144
169
# 用最新的补丁版本号替换 {{< skew currentVersion >}}.x-00 中的 x
145
170
apt-mark unhold kubeadm && \
146
171
apt-get update && apt-get install -y kubeadm={{< skew currentVersion > }}.x-00 && \
147
172
apt-mark hold kubeadm
148
173
-
149
- # 从 apt-get 1.1 版本起,你也可以使用下面的方法
150
- apt-get update && \
151
- apt-get install -y --allow-change-held-packages kubeadm={{< skew currentVersion > }}.x-00
152
- ```
174
+
153
175
{{% /tab %}}
154
176
{{% tab name=" CentOS、RHEL 或 Fedora" %}}
155
177
` ` ` shell
156
178
# 用最新的补丁版本号替换 {{< skew currentVersion >}}.x-0 中的 x
157
179
yum install -y kubeadm-{{< skew currentVersion > }}.x-0 --disableexcludes=kubernetes
158
180
` ` `
181
+
159
182
{{% /tab %}}
160
183
{{< /tabs > }}
184
+ < br />
161
185
162
186
< ! --
163
187
- Verify that the download works and has the expected version:
@@ -226,7 +250,7 @@ yum install -y kubeadm-{{< skew currentVersion >}}.x-0 --disableexcludes=kuberne
226
250
-->
227
251
一旦该命令结束,你应该会看到:
228
252
229
- ```
253
+ ` ` ` console
230
254
[upgrade/successful] SUCCESS! Your cluster was upgraded to " v{{< skew currentVersion >}}.x" . Enjoy!
231
255
232
256
[upgrade/kubelet] Now that your control plane is upgraded, please proceed with upgrading your kubelets if you haven' t already done so.
@@ -259,7 +283,7 @@ Same as the first control plane node but use:
259
283
-->
260
284
与第一个控制面节点相同,但是使用:
261
285
262
- ```
286
+ ```shell
263
287
sudo kubeadm upgrade node
264
288
```
265
289
@@ -268,7 +292,7 @@ instead of:
268
292
-->
269
293
而不是:
270
294
271
- ```
295
+ ```shell
272
296
sudo kubeadm upgrade apply
273
297
```
274
298
@@ -299,34 +323,33 @@ Also calling `kubeadm upgrade plan` and upgrading the CNI provider plugin is no
299
323
<!--
300
324
### Upgrade kubelet and kubectl
301
325
302
- - Upgrade the kubelet and kubectl
326
+ - Upgrade the kubelet and kubectl:
303
327
-->
304
328
### 升级 kubelet 和 kubectl
305
329
306
- - 升级 kubelet 和 kubectl
330
+ - 升级 kubelet 和 kubectl:
307
331
308
332
{{< tabs name="k8s_install_kubelet" >}}
309
333
{{% tab name="Ubuntu、Debian 或 HypriotOS" %}}
310
334
311
- <pre >
312
- # 用最新的补丁版本替换 {{< skew currentVersion >}}.x-00 中的 x
313
- apt-mark unhold kubelet kubectl && \
314
- apt-get update && apt-get install -y kubelet={{< skew currentVersion >}}.x-00 kubectl={{< skew currentVersion >}}.x-00 && \
315
- apt-mark hold kubelet kubectl
316
- -
317
- # 从 apt-get 的 1.1 版本开始,你也可以使用下面的方法:
318
- apt-get update && \
319
- apt-get install -y --allow-change-held-packages kubelet={{< skew currentVersion >}}.x-00 kubectl={{< skew currentVersion >}}.x-00
320
- </pre >
335
+ ```shell
336
+ # 用最新的补丁版本替换 {{< skew currentVersion >}}.x-00 中的 x
337
+ apt-mark unhold kubelet kubectl && \
338
+ apt-get update && apt-get install -y kubelet={{< skew currentVersion >}}.x-00 kubectl={{< skew currentVersion >}}.x-00 && \
339
+ apt-mark hold kubelet kubectl
340
+ ```
341
+
321
342
{{% /tab %}}
322
343
{{% tab name="CentOS、RHEL 或 Fedora" %}}
323
-
324
- <pre >
325
- # 用最新的补丁版本号替换 {{< skew currentVersion >}}.x-00 中的 x
326
- yum install -y kubelet-{{< skew currentVersion >}}.x-0 kubectl-{{< skew currentVersion >}}.x-0 --disableexcludes=kubernetes
327
- </pre >
344
+
345
+ ```shell
346
+ # 用最新的补丁版本号替换 {{< skew currentVersion >}}.x-00 中的 x
347
+ yum install -y kubelet-{{< skew currentVersion >}}.x-0 kubectl-{{< skew currentVersion >}}.x-0 --disableexcludes=kubernetes
348
+ ```
349
+
328
350
{{% /tab %}}
329
351
{{< /tabs >}}
352
+ <br />
330
353
331
354
<!--
332
355
- Restart the kubelet
@@ -380,24 +403,22 @@ without compromising the minimum required capacity for running your workloads.
380
403
381
404
{{< tabs name="k8s_install_kubeadm_worker_nodes" >}}
382
405
{{% tab name="Ubuntu、Debian 或 HypriotOS" %}}
383
-
406
+
384
407
```shell
385
408
# 将 {{< skew currentVersion >}}.x-00 中的 x 替换为最新的补丁版本号
386
409
apt-mark unhold kubeadm && \
387
410
apt-get update && apt-get install -y kubeadm={{< skew currentVersion >}}.x-00 && \
388
411
apt-mark hold kubeadm
389
- -
390
- # 从 apt-get 的 1.1 版本开始,你也可以使用下面的方法:
391
- apt-get update && \
392
- apt-get install -y --allow-change-held-packages kubeadm={{< skew currentVersion > }}.x-00
393
412
```
413
+
394
414
{{% /tab %}}
395
415
{{% tab name="CentOS、RHEL 或 Fedora" %}}
396
-
416
+
397
417
```shell
398
418
# 用最新的补丁版本替换 {{< skew currentVersion >}}.x-00 中的 x
399
419
yum install -y kubeadm-{{< skew currentVersion >}}.x-0 --disableexcludes=kubernetes
400
420
```
421
+
401
422
{{% /tab %}}
402
423
{{< /tabs >}}
403
424
@@ -445,26 +466,22 @@ without compromising the minimum required capacity for running your workloads.
445
466
446
467
{{< tabs name="k8s_kubelet_and_kubectl" >}}
447
468
{{% tab name="Ubuntu、Debian 或 HypriotOS" %}}
448
-
469
+
449
470
```shell
450
471
# 将 {{< skew currentVersion >}}.x-00 中的 x 替换为最新的补丁版本
451
472
apt-mark unhold kubelet kubectl && \
452
473
apt-get update && apt-get install -y kubelet={{< skew currentVersion >}}.x-00 kubectl={{< skew currentVersion >}}.x-00 && \
453
474
apt-mark hold kubelet kubectl
454
-
455
- # 从 apt-get 的 1.1 版本开始,你也可以使用下面的方法:
456
-
457
- apt-get update && \
458
- apt-get install -y --allow-change-held-packages kubelet={{< skew currentVersion > }}.x-00 kubectl={{< skew currentVersion > }}.x-00
459
475
```
460
-
476
+
461
477
{{% /tab %}}
462
478
{{% tab name="CentOS, RHEL or Fedora" %}}
463
-
479
+
464
480
```shell
465
481
# 将 {{< skew currentVersion >}}.x-0 x 替换为最新的补丁版本
466
482
yum install -y kubelet-{{< skew currentVersion >}}.x-0 kubectl-{{< skew currentVersion >}}.x-0 --disableexcludes=kubernetes
467
483
```
484
+
468
485
{{% /tab %}}
469
486
{{< /tabs >}}
470
487
@@ -524,7 +541,7 @@ kubectl get nodes
524
541
<!--
525
542
The `STATUS` column should show `Ready` for all your nodes, and the version number should be updated.
526
543
-->
527
- ` STATUS ` 应显示所有节点为 ` Ready ` 状态,并且版本号已经被更新。
544
+ `STATUS` 应显示所有节点为 `Ready` 状态,并且版本号已经被更新。
528
545
529
546
<!--
530
547
## Recovering from a failure state
@@ -624,6 +641,5 @@ and post-upgrade manifest file for a certain component, a backup file for it wil
624
641
-->
625
642
` kubeadm upgrade node` 在工作节点上完成以下工作:
626
643
627
- - 从集群取回 kubeadm ` ClusterConfiguration ` 。
644
+ - 从集群取回 kubeadm ` ClusterConfiguration` 。
628
645
- 为本节点升级 kubelet 配置。
629
-
0 commit comments