Skip to content

Commit 1068d45

Browse files
authored
Merge pull request #43459 from windsonsea/packrep
[zh] Sync change-package-repository.md
2 parents 17ed43e + 37cb4e7 commit 1068d45

File tree

3 files changed

+90
-26
lines changed

3 files changed

+90
-26
lines changed

content/zh-cn/docs/tasks/administer-cluster/kubeadm/change-package-repository.md

Lines changed: 73 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,37 @@ weight: 120
1212
<!-- overview -->
1313

1414
<!--
15-
This page explains how to switch from one Kubernetes package repository to another
16-
when upgrading Kubernetes minor releases. Unlike deprecated Google-hosted
17-
repositories, the Kubernetes package repositories are structured in a way that
18-
there's a dedicated package repository for each Kubernetes minor version.
15+
This page explains how to enable a package repository for a new Kubernetes minor release
16+
for users of the community-owned package repositories hosted at `pkgs.k8s.io`.
17+
Unlike the legacy package repositories, the community-owned package repositories are
18+
structured in a way that there's a dedicated package repository for each Kubernetes
19+
minor version.
1920
-->
20-
本文阐述如何在升级 Kubernetes 小版本时从一个软件包仓库切换到另一个。
21-
与弃用的 Google 托管仓库不同,Kubernetes 软件包仓库的结构是每个 Kubernetes
22-
小版本都有一个专门的软件包仓库。
21+
本文阐述如何为 `pkgs.k8s.io` 上托管的、社区自治的软件包仓库的用户,
22+
启用新的 Kubernetes 小版本的软件包仓库。与传统的软件包仓库不同,
23+
社区自治的软件包仓库所采用的结构为每个 Kubernetes 小版本都有一个专门的软件包仓库。
2324

2425
## {{% heading "prerequisites" %}}
2526

2627
<!--
27-
This document assumes that you're already using the Kubernetes community-owned
28-
package repositories. If that's not the case, it's strongly recommend to migrate
29-
to the Kubernetes package repositories.
28+
This document assumes that you're already using the community-owned
29+
package repositories (`pkgs.k8s.io`). If that's not the case, it's strongly
30+
recommended to migrate to the community-owned package repositories as described
31+
in the [official announcement](/blog/2023/08/15/pkgs-k8s-io-introduction/).
3032
-->
31-
本文假设你已经在使用 Kubernetes 社区所拥有的软件包仓库。
32-
如果不是这种情况,强烈建议迁移到 Kubernetes 软件包仓库。
33+
本文假设你已经在使用社区自治的软件包仓库(`pkgs.k8s.io`)。如果不是这种情况,
34+
强烈建议按照[官方公告](/zh-cn/blog/2023/08/15/pkgs-k8s-io-introduction/)中所述,
35+
迁移到社区自治的软件包仓库。
3336

3437
<!--
3538
### Verifying if the Kubernetes package repositories are used
3639
37-
If you're unsure if you're using the Kubernetes package repositories or the
38-
Google-hosted repository, take the following steps to verify:
40+
If you're unsure whether you're using the community-owned package repositories or the
41+
legacy package repositories, take the following steps to verify:
3942
-->
4043
### 验证是否正在使用 Kubernetes 软件包仓库
4144

42-
如果你不确定自己是在使用 Kubernetes 软件包仓库还是在使用 Google 托管的仓库
45+
如果你不确定自己是在使用社区自治的软件包仓库还是在使用老旧的软件包仓库
4346
可以执行以下步骤进行验证:
4447

4548
{{< tabs name="k8s_install_versions" >}}
@@ -70,10 +73,12 @@ deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io
7073

7174
<!--
7275
**You're using the Kubernetes package repositories and this guide applies to you.**
73-
Otherwise, it's strongly recommend to migrate to the Kubernetes package repositories.
76+
Otherwise, it's strongly recommended to migrate to the Kubernetes package repositories
77+
as described in the [official announcement](/blog/2023/08/15/pkgs-k8s-io-introduction/).
7478
-->
7579
**你正在使用 Kubernetes 软件包仓库,本指南适用于你。**
76-
否则,强烈建议迁移到 Kubernetes 软件包仓库。
80+
否则,强烈建议按照[官方公告](/zh-cn/blog/2023/08/15/pkgs-k8s-io-introduction/)中所述,
81+
迁移到 Kubernetes 软件包仓库。
7782

7883
{{% /tab %}}
7984
{{% tab name="CentOS、RHEL 或 Fedora" %}}
@@ -86,7 +91,7 @@ Print the contents of the file that defines the Kubernetes `yum` repository:
8691
cat /etc/yum.repos.d/kubernetes.repo
8792
```
8893
89-
If you see `baseurl` similar to the `baseurl` in the output below:
94+
If you see a `baseurl` similar to the `baseurl` in the output below:
9095
-->
9196
打印定义 Kubernetes `yum` 仓库的文件的内容:
9297

@@ -109,10 +114,54 @@ exclude=kubelet kubeadm kubectl
109114

110115
<!--
111116
**You're using the Kubernetes package repositories and this guide applies to you.**
112-
Otherwise, it's strongly recommend to migrate to the Kubernetes package repositories.
117+
Otherwise, it's strongly recommended to migrate to the Kubernetes package repositories
118+
as described in the [official announcement](/blog/2023/08/15/pkgs-k8s-io-introduction/).
113119
-->
114120
**你正在使用 Kubernetes 软件包仓库,本指南适用于你。**
115-
否则,强烈建议迁移到 Kubernetes 软件包仓库。
121+
否则,强烈建议按照[官方公告](/zh-cn/blog/2023/08/15/pkgs-k8s-io-introduction/)中所述,
122+
迁移到 Kubernetes 软件包仓库。
123+
124+
{{% /tab %}}
125+
126+
{{% tab name="openSUSE 或 SLES" %}}
127+
128+
<!--
129+
Print the contents of the file that defines the Kubernetes `zypper` repository:
130+
131+
```shell
132+
# On your system, this configuration file could have a different name
133+
cat /etc/zypp/repos.d/kubernetes.repo
134+
```
135+
136+
If you see a `baseurl` similar to the `baseurl` in the output below:
137+
-->
138+
打印定义 Kubernetes `zypper` 仓库的文件的内容:
139+
140+
```shell
141+
# 在你的系统上,此配置文件可能具有不同的名称
142+
cat /etc/zypp/repos.d/kubernetes.repo
143+
```
144+
145+
如果你看到的 `baseurl` 类似以下输出中的 `baseurl`
146+
147+
```
148+
[kubernetes]
149+
name=Kubernetes
150+
baseurl=https://pkgs.k8s.io/core:/stable:/v{{< skew currentVersionAddMinor -1 "." >}}/rpm/
151+
enabled=1
152+
gpgcheck=1
153+
gpgkey=https://pkgs.k8s.io/core:/stable:/v{{< skew currentVersionAddMinor -1 "." >}}/rpm/repodata/repomd.xml.key
154+
exclude=kubelet kubeadm kubectl
155+
```
156+
157+
<!--
158+
**You're using the Kubernetes package repositories and this guide applies to you.**
159+
Otherwise, it's strongly recommended to migrate to the Kubernetes package repositories
160+
as described in the [official announcement](/blog/2023/08/15/pkgs-k8s-io-introduction/).
161+
-->
162+
**你正在使用 Kubernetes 软件包仓库,本指南适用于你。**
163+
否则,强烈建议按照[官方公告](/zh-cn/blog/2023/08/15/pkgs-k8s-io-introduction/)中所述,
164+
迁移到 Kubernetes 软件包仓库。
116165

117166
{{% /tab %}}
118167
{{< /tabs >}}
@@ -167,7 +216,7 @@ version.
167216
```
168217

169218
<!--
170-
2. Change the version in the URL to **the next available minor release**, for example:
219+
1. Change the version in the URL to **the next available minor release**, for example:
171220
-->
172221
2. 将 URL 中的版本更改为**下一个可用的小版本**,例如:
173222

@@ -176,7 +225,7 @@ version.
176225
```
177226

178227
<!--
179-
3. Save the file and exit your text editor. Continue following the relevant upgrade instructions.
228+
1. Save the file and exit your text editor. Continue following the relevant upgrade instructions.
180229
-->
181230
3. 保存文件并退出文本编辑器。继续按照相关的升级说明进行操作。
182231

@@ -211,7 +260,7 @@ version.
211260
```
212261

213262
<!--
214-
2. Change the version in these URLs to **the next available minor release**, for example:
263+
1. Change the version in these URLs to **the next available minor release**, for example:
215264
-->
216265
2. 将这些 URL 中的版本更改为**下一个可用的小版本**,例如:
217266

@@ -226,7 +275,7 @@ version.
226275
```
227276

228277
<!--
229-
3. Save the file and exit your text editor. Continue following the relevant upgrade instructions.
278+
1. Save the file and exit your text editor. Continue following the relevant upgrade instructions.
230279
-->
231280
3. 保存文件并退出文本编辑器。继续按照相关的升级说明进行操作。
232281

content/zh-cn/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,12 @@ The upgrade workflow at high level is the following:
111111
If you're using the community-owned package repositories (`pkgs.k8s.io`), you need to
112112
enable the package repository for the desired Kubernetes minor release. This is explained in
113113
[Changing the Kubernetes package repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/)
114+
document.
114115
-->
115116
## 更改软件包仓库 {#changing-the-package-repository}
116117

117-
如果你正在使用社区版的软件包仓库(pkgs.k8s.io),
118-
你需要启用所需的 Kubernetes 次要版本的软件包仓库
118+
如果你正在使用社区版的软件包仓库(`pkgs.k8s.io`),
119+
你需要启用所需的 Kubernetes 小版本的软件包仓库
119120
这一点在[更改 Kubernetes 软件包仓库](/zh-cn/docs/tasks/administer-cluster/kubeadm/change-package-repository/)文档中有详细说明。
120121

121122
<!--

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ upgrade the control plane nodes before upgrading your Linux Worker nodes.
3030

3131
<!-- steps -->
3232

33+
<!--
34+
## Changing the package repository
35+
36+
If you're using the community-owned package repositories (`pkgs.k8s.io`), you need to
37+
enable the package repository for the desired Kubernetes minor release. This is explained in
38+
[Changing the Kubernetes package repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/)
39+
document.
40+
-->
41+
## 更改软件包仓库 {#changing-the-package-repository}
42+
43+
如果你正在使用社区自治的软件包仓库(`pkgs.k8s.io`),
44+
你需要启用所需的 Kubernetes 小版本的软件包仓库。
45+
这一点在[更改 Kubernetes 软件包仓库](/zh-cn/docs/tasks/administer-cluster/kubeadm/change-package-repository/)文档中有详细说明。
46+
3347
<!--
3448
## Upgrading worker nodes
3549

0 commit comments

Comments
 (0)