@@ -105,6 +105,20 @@ The upgrade workflow at high level is the following:
105
105
106
106
<!-- steps -->
107
107
108
+ <!--
109
+ ## Changing the package repository
110
+
111
+ If you're using the Kubernetes community-owned repositories, you need to change
112
+ the package repository to one that contains packages for your desired Kubernetes
113
+ minor version. This is explained in [Changing the Kubernetes package repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/)
114
+ document.
115
+ -->
116
+ ## 更改软件包仓库 {#changing-the-package-repository}
117
+
118
+ 如果你使用的是 Kubernetes 社区所属的软件包仓库,
119
+ 你需要将软件包仓库更改为一个包含所需 Kubernetes 次要版本软件包的仓库。
120
+ 这一点在[ 更改 Kubernetes 软件包仓库] ( /zh-cn/docs/tasks/administer-cluster/kubeadm/change-package-repository/ ) 文档中有详细说明。
121
+
108
122
<!--
109
123
## Determine which version to upgrade to
110
124
-->
@@ -119,11 +133,11 @@ Find the latest patch release for Kubernetes {{< skew currentVersion >}} using t
119
133
{{% tab name="Ubuntu, Debian or HypriotOS" %}}
120
134
<!--
121
135
# Find the latest {{< skew currentVersion >}} version in the list.
122
- # It should look like {{< skew currentVersion >}}.x-00 , where x is the latest patch.
136
+ # It should look like {{< skew currentVersion >}}.x-* , where x is the latest patch.
123
137
-->
124
138
``` shell
125
139
# 在列表中查找最新的 {{< skew currentVersion >}} 版本
126
- # 它看起来应该是 {{< skew currentVersion >}}.x-00 ,其中 x 是最新的补丁版本
140
+ # 它看起来应该是 {{< skew currentVersion >}}.x-* ,其中 x 是最新的补丁版本
127
141
apt update
128
142
apt-cache madison kubeadm
129
143
```
@@ -132,11 +146,11 @@ apt-cache madison kubeadm
132
146
{{% tab name="CentOS, RHEL or Fedora" %}}
133
147
<!--
134
148
# Find the latest {{< skew currentVersion >}} version in the list.
135
- # It should look like {{< skew currentVersion >}}.x-0 , where x is the latest patch.
149
+ # It should look like {{< skew currentVersion >}}.x-* , where x is the latest patch.
136
150
-->
137
151
``` shell
138
152
# 在列表中查找最新的 {{< skew currentVersion >}} 版本
139
- # 它看起来应该是 {{< skew currentVersion >}}.x-0 ,其中 x 是最新的补丁版本
153
+ # 它看起来应该是 {{< skew currentVersion >}}.x-* ,其中 x 是最新的补丁版本
140
154
yum list --showduplicates kubeadm --disableexcludes=kubernetes
141
155
```
142
156
@@ -175,24 +189,24 @@ Pick a control plane node that you wish to upgrade first. It must have the `/etc
175
189
{{% tab name="Ubuntu, Debian or HypriotOS" %}}
176
190
177
191
<!--
178
- # replace x in {{< skew currentVersion >}}.x-00 with the latest patch version
192
+ # replace x in {{< skew currentVersion >}}.x-* with the latest patch version
179
193
-->
180
194
``` shell
181
- # 用最新的补丁版本号替换 {{< skew currentVersion >}}.x-00 中的 x
195
+ # 用最新的补丁版本号替换 {{< skew currentVersion >}}.x-* 中的 x
182
196
apt-mark unhold kubeadm && \
183
- apt-get update && apt-get install -y kubeadm={{< skew currentVersion > }}.x-00 && \
197
+ apt-get update && apt-get install -y kubeadm=' {{< skew currentVersion >}}.x-* ' && \
184
198
apt-mark hold kubeadm
185
199
```
186
200
187
201
{{% /tab %}}
188
202
{{% tab name="CentOS, RHEL or Fedora" %}}
189
203
190
204
<!--
191
- # replace x in {{< skew currentVersion >}}.x-0 with the latest patch version
205
+ # replace x in {{< skew currentVersion >}}.x-* with the latest patch version
192
206
-->
193
207
``` shell
194
- # 用最新的补丁版本号替换 {{< skew currentVersion >}}.x-0 中的 x
195
- yum install -y kubeadm-{{< skew currentVersion > }}.x-0 --disableexcludes=kubernetes
208
+ # 用最新的补丁版本号替换 {{< skew currentVersion >}}.x-* 中的 x
209
+ yum install -y kubeadm-' {{< skew currentVersion >}}.x-* ' --disableexcludes=kubernetes
196
210
```
197
211
198
212
{{% /tab %}}
@@ -272,6 +286,34 @@ Pick a control plane node that you wish to upgrade first. It must have the `/etc
272
286
[upgrade/kubelet] Now that your control plane is upgraded, please proceed with upgrading your kubelets if you haven't already done so.
273
287
```
274
288
289
+ {{< note >}}
290
+
291
+ <!--
292
+ For versions earlier than v1.28, kubeadm defaulted to a mode that upgrades the addons (including CoreDNS and kube-proxy)
293
+ immediately during `kubeadm upgrade apply`, regardless of whether there are other control plane instances that have not
294
+ been upgraded. This may cause compatibility problems. Since v1.28, kubeadm defaults to a mode that checks whether all
295
+ the control plane instances have been upgraded before starting to upgrade the addons. You must perform control plane
296
+ instances upgrade sequentially or at least ensure that the last control plane instance upgrade is not started until all
297
+ the other control plane instances have been upgraded completely, and the addons upgrade will be performed after the last
298
+ control plane instance is upgraded. If you want to keep the old upgrade behavior, please enable the `UpgradeAddonsBeforeControlPlane`
299
+ feature gate by `kubeadm upgrade apply --feature-gates=UpgradeAddonsBeforeControlPlane=true`. The Kubernetes project does
300
+ not in general recommend enabling this feature gate, you should instead change your upgrade process or cluster addons so
301
+ that you do not need to enable the legacy behavior. The `UpgradeAddonsBeforeControlPlane` feature gate will be removed in
302
+ a future release.
303
+ -->
304
+ 对于 v1.28 之前的版本,kubeadm 默认采用这样一种模式:在 ` kubeadm upgrade apply `
305
+ 期间立即升级插件(包括 CoreDNS 和 kube-proxy),而不管是否还有其他尚未升级的控制平面实例。
306
+ 这可能会导致兼容性问题。从 v1.28 开始,kubeadm 默认采用这样一种模式:
307
+ 在开始升级插件之前,先检查是否已经升级所有的控制平面实例。
308
+ 你必须按顺序执行控制平面实例的升级,或者至少确保在所有其他控制平面实例已完成升级之前不启动最后一个控制平面实例的升级,
309
+ 并且在最后一个控制平面实例完成升级之后才执行插件的升级。如果你要保留旧的升级行为,可以通过
310
+ ` kubeadm upgrade apply --feature-gates=UpgradeAddonsBeforeControlPlane=true ` 启用
311
+ ` UpgradeAddonsBeforeControlPlane ` 特性门控。Kubernetes 项目通常不建议启用此特性门控,
312
+ 你应该转为更改你的升级过程或集群插件,这样你就不需要启用旧的行为。
313
+ ` UpgradeAddonsBeforeControlPlane ` 特性门控将在后续的版本中被移除。
314
+
315
+ {{</ note >}}
316
+
275
317
<!--
276
318
1. Manually upgrade your CNI provider plugin.
277
319
-->
@@ -354,24 +396,24 @@ kubectl drain <node-to-drain> --ignore-daemonsets
354
396
{{% tab name="Ubuntu, Debian or HypriotOS" %}}
355
397
356
398
<!--
357
- # replace x in {{< skew currentVersion >}}.x-00 with the latest patch version
399
+ # replace x in {{< skew currentVersion >}}.x-* with the latest patch version
358
400
-->
359
401
``` shell
360
- # 用最新的补丁版本替换 {{< skew currentVersion >}}.x-00 中的 x
402
+ # 用最新的补丁版本替换 {{< skew currentVersion >}}.x-* 中的 x
361
403
apt-mark unhold kubelet kubectl && \
362
- apt-get update && apt-get install -y kubelet={{< skew currentVersion > }}.x-00 kubectl={{< skew currentVersion > }}.x-00 && \
404
+ apt-get update && apt-get install -y kubelet=' {{< skew currentVersion >}}.x-* ' kubectl=' {{< skew currentVersion >}}.x-* ' && \
363
405
apt-mark hold kubelet kubectl
364
406
```
365
407
366
408
{{% /tab %}}
367
409
{{% tab name="CentOS, RHEL or Fedora" %}}
368
410
369
411
<!--
370
- # replace x in {{< skew currentVersion >}}.x-0 with the latest patch version
412
+ # replace x in {{< skew currentVersion >}}.x-* with the latest patch version
371
413
-->
372
414
``` shell
373
- # 用最新的补丁版本号替换 {{< skew currentVersion >}}.x-00 中的 x
374
- yum install -y kubelet-{{< skew currentVersion > }}.x-0 kubectl-{{< skew currentVersion > }}.x-0 --disableexcludes=kubernetes
415
+ # 用最新的补丁版本号替换 {{< skew currentVersion >}}.x-* 中的 x
416
+ yum install -y kubelet-' {{< skew currentVersion >}}.x-* ' kubectl-' {{< skew currentVersion >}}.x-* ' --disableexcludes=kubernetes
375
417
```
376
418
377
419
{{% /tab %}}
0 commit comments