Merge pull request #43459 from windsonsea/packrep
[zh] Sync change-package-repository.mdpull/43481/head
commit
1068d4546d
|
@ -12,34 +12,37 @@ weight: 120
|
|||
<!-- overview -->
|
||||
|
||||
<!--
|
||||
This page explains how to switch from one Kubernetes package repository to another
|
||||
when upgrading Kubernetes minor releases. Unlike deprecated Google-hosted
|
||||
repositories, the Kubernetes package repositories are structured in a way that
|
||||
there's a dedicated package repository for each Kubernetes minor version.
|
||||
This page explains how to enable a package repository for a new Kubernetes minor release
|
||||
for users of the community-owned package repositories hosted at `pkgs.k8s.io`.
|
||||
Unlike the legacy package repositories, the community-owned package repositories are
|
||||
structured in a way that there's a dedicated package repository for each Kubernetes
|
||||
minor version.
|
||||
-->
|
||||
本文阐述如何在升级 Kubernetes 小版本时从一个软件包仓库切换到另一个。
|
||||
与弃用的 Google 托管仓库不同,Kubernetes 软件包仓库的结构是每个 Kubernetes
|
||||
小版本都有一个专门的软件包仓库。
|
||||
本文阐述如何为 `pkgs.k8s.io` 上托管的、社区自治的软件包仓库的用户,
|
||||
启用新的 Kubernetes 小版本的软件包仓库。与传统的软件包仓库不同,
|
||||
社区自治的软件包仓库所采用的结构为每个 Kubernetes 小版本都有一个专门的软件包仓库。
|
||||
|
||||
## {{% heading "prerequisites" %}}
|
||||
|
||||
<!--
|
||||
This document assumes that you're already using the Kubernetes community-owned
|
||||
package repositories. If that's not the case, it's strongly recommend to migrate
|
||||
to the Kubernetes package repositories.
|
||||
This document assumes that you're already using the community-owned
|
||||
package repositories (`pkgs.k8s.io`). If that's not the case, it's strongly
|
||||
recommended to migrate to the community-owned package repositories as described
|
||||
in the [official announcement](/blog/2023/08/15/pkgs-k8s-io-introduction/).
|
||||
-->
|
||||
本文假设你已经在使用 Kubernetes 社区所拥有的软件包仓库。
|
||||
如果不是这种情况,强烈建议迁移到 Kubernetes 软件包仓库。
|
||||
本文假设你已经在使用社区自治的软件包仓库(`pkgs.k8s.io`)。如果不是这种情况,
|
||||
强烈建议按照[官方公告](/zh-cn/blog/2023/08/15/pkgs-k8s-io-introduction/)中所述,
|
||||
迁移到社区自治的软件包仓库。
|
||||
|
||||
<!--
|
||||
### Verifying if the Kubernetes package repositories are used
|
||||
|
||||
If you're unsure if you're using the Kubernetes package repositories or the
|
||||
Google-hosted repository, take the following steps to verify:
|
||||
If you're unsure whether you're using the community-owned package repositories or the
|
||||
legacy package repositories, take the following steps to verify:
|
||||
-->
|
||||
### 验证是否正在使用 Kubernetes 软件包仓库
|
||||
|
||||
如果你不确定自己是在使用 Kubernetes 软件包仓库还是在使用 Google 托管的仓库,
|
||||
如果你不确定自己是在使用社区自治的软件包仓库还是在使用老旧的软件包仓库,
|
||||
可以执行以下步骤进行验证:
|
||||
|
||||
{{< tabs name="k8s_install_versions" >}}
|
||||
|
@ -70,10 +73,12 @@ deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io
|
|||
|
||||
<!--
|
||||
**You're using the Kubernetes package repositories and this guide applies to you.**
|
||||
Otherwise, it's strongly recommend to migrate to the Kubernetes package repositories.
|
||||
Otherwise, it's strongly recommended to migrate to the Kubernetes package repositories
|
||||
as described in the [official announcement](/blog/2023/08/15/pkgs-k8s-io-introduction/).
|
||||
-->
|
||||
**你正在使用 Kubernetes 软件包仓库,本指南适用于你。**
|
||||
否则,强烈建议迁移到 Kubernetes 软件包仓库。
|
||||
否则,强烈建议按照[官方公告](/zh-cn/blog/2023/08/15/pkgs-k8s-io-introduction/)中所述,
|
||||
迁移到 Kubernetes 软件包仓库。
|
||||
|
||||
{{% /tab %}}
|
||||
{{% tab name="CentOS、RHEL 或 Fedora" %}}
|
||||
|
@ -86,7 +91,7 @@ Print the contents of the file that defines the Kubernetes `yum` repository:
|
|||
cat /etc/yum.repos.d/kubernetes.repo
|
||||
```
|
||||
|
||||
If you see `baseurl` similar to the `baseurl` in the output below:
|
||||
If you see a `baseurl` similar to the `baseurl` in the output below:
|
||||
-->
|
||||
打印定义 Kubernetes `yum` 仓库的文件的内容:
|
||||
|
||||
|
@ -109,10 +114,54 @@ exclude=kubelet kubeadm kubectl
|
|||
|
||||
<!--
|
||||
**You're using the Kubernetes package repositories and this guide applies to you.**
|
||||
Otherwise, it's strongly recommend to migrate to the Kubernetes package repositories.
|
||||
Otherwise, it's strongly recommended to migrate to the Kubernetes package repositories
|
||||
as described in the [official announcement](/blog/2023/08/15/pkgs-k8s-io-introduction/).
|
||||
-->
|
||||
**你正在使用 Kubernetes 软件包仓库,本指南适用于你。**
|
||||
否则,强烈建议迁移到 Kubernetes 软件包仓库。
|
||||
否则,强烈建议按照[官方公告](/zh-cn/blog/2023/08/15/pkgs-k8s-io-introduction/)中所述,
|
||||
迁移到 Kubernetes 软件包仓库。
|
||||
|
||||
{{% /tab %}}
|
||||
|
||||
{{% tab name="openSUSE 或 SLES" %}}
|
||||
|
||||
<!--
|
||||
Print the contents of the file that defines the Kubernetes `zypper` repository:
|
||||
|
||||
```shell
|
||||
# On your system, this configuration file could have a different name
|
||||
cat /etc/zypp/repos.d/kubernetes.repo
|
||||
```
|
||||
|
||||
If you see a `baseurl` similar to the `baseurl` in the output below:
|
||||
-->
|
||||
打印定义 Kubernetes `zypper` 仓库的文件的内容:
|
||||
|
||||
```shell
|
||||
# 在你的系统上,此配置文件可能具有不同的名称
|
||||
cat /etc/zypp/repos.d/kubernetes.repo
|
||||
```
|
||||
|
||||
如果你看到的 `baseurl` 类似以下输出中的 `baseurl`:
|
||||
|
||||
```
|
||||
[kubernetes]
|
||||
name=Kubernetes
|
||||
baseurl=https://pkgs.k8s.io/core:/stable:/v{{< skew currentVersionAddMinor -1 "." >}}/rpm/
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=https://pkgs.k8s.io/core:/stable:/v{{< skew currentVersionAddMinor -1 "." >}}/rpm/repodata/repomd.xml.key
|
||||
exclude=kubelet kubeadm kubectl
|
||||
```
|
||||
|
||||
<!--
|
||||
**You're using the Kubernetes package repositories and this guide applies to you.**
|
||||
Otherwise, it's strongly recommended to migrate to the Kubernetes package repositories
|
||||
as described in the [official announcement](/blog/2023/08/15/pkgs-k8s-io-introduction/).
|
||||
-->
|
||||
**你正在使用 Kubernetes 软件包仓库,本指南适用于你。**
|
||||
否则,强烈建议按照[官方公告](/zh-cn/blog/2023/08/15/pkgs-k8s-io-introduction/)中所述,
|
||||
迁移到 Kubernetes 软件包仓库。
|
||||
|
||||
{{% /tab %}}
|
||||
{{< /tabs >}}
|
||||
|
@ -167,7 +216,7 @@ version.
|
|||
```
|
||||
|
||||
<!--
|
||||
2. Change the version in the URL to **the next available minor release**, for example:
|
||||
1. Change the version in the URL to **the next available minor release**, for example:
|
||||
-->
|
||||
2. 将 URL 中的版本更改为**下一个可用的小版本**,例如:
|
||||
|
||||
|
@ -176,7 +225,7 @@ version.
|
|||
```
|
||||
|
||||
<!--
|
||||
3. Save the file and exit your text editor. Continue following the relevant upgrade instructions.
|
||||
1. Save the file and exit your text editor. Continue following the relevant upgrade instructions.
|
||||
-->
|
||||
3. 保存文件并退出文本编辑器。继续按照相关的升级说明进行操作。
|
||||
|
||||
|
@ -211,7 +260,7 @@ version.
|
|||
```
|
||||
|
||||
<!--
|
||||
2. Change the version in these URLs to **the next available minor release**, for example:
|
||||
1. Change the version in these URLs to **the next available minor release**, for example:
|
||||
-->
|
||||
2. 将这些 URL 中的版本更改为**下一个可用的小版本**,例如:
|
||||
|
||||
|
@ -226,7 +275,7 @@ version.
|
|||
```
|
||||
|
||||
<!--
|
||||
3. Save the file and exit your text editor. Continue following the relevant upgrade instructions.
|
||||
1. Save the file and exit your text editor. Continue following the relevant upgrade instructions.
|
||||
-->
|
||||
3. 保存文件并退出文本编辑器。继续按照相关的升级说明进行操作。
|
||||
|
||||
|
|
|
@ -111,11 +111,12 @@ The upgrade workflow at high level is the following:
|
|||
If you're using the community-owned package repositories (`pkgs.k8s.io`), you need to
|
||||
enable the package repository for the desired Kubernetes minor release. This is explained in
|
||||
[Changing the Kubernetes package repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/)
|
||||
document.
|
||||
-->
|
||||
## 更改软件包仓库 {#changing-the-package-repository}
|
||||
|
||||
如果你正在使用社区版的软件包仓库(pkgs.k8s.io),
|
||||
你需要启用所需的 Kubernetes 次要版本的软件包仓库。
|
||||
如果你正在使用社区版的软件包仓库(`pkgs.k8s.io`),
|
||||
你需要启用所需的 Kubernetes 小版本的软件包仓库。
|
||||
这一点在[更改 Kubernetes 软件包仓库](/zh-cn/docs/tasks/administer-cluster/kubeadm/change-package-repository/)文档中有详细说明。
|
||||
|
||||
<!--
|
||||
|
|
|
@ -30,6 +30,20 @@ upgrade the control plane nodes before upgrading your Linux Worker nodes.
|
|||
|
||||
<!-- steps -->
|
||||
|
||||
<!--
|
||||
## Changing the package repository
|
||||
|
||||
If you're using the community-owned package repositories (`pkgs.k8s.io`), you need to
|
||||
enable the package repository for the desired Kubernetes minor release. This is explained in
|
||||
[Changing the Kubernetes package repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/)
|
||||
document.
|
||||
-->
|
||||
## 更改软件包仓库 {#changing-the-package-repository}
|
||||
|
||||
如果你正在使用社区自治的软件包仓库(`pkgs.k8s.io`),
|
||||
你需要启用所需的 Kubernetes 小版本的软件包仓库。
|
||||
这一点在[更改 Kubernetes 软件包仓库](/zh-cn/docs/tasks/administer-cluster/kubeadm/change-package-repository/)文档中有详细说明。
|
||||
|
||||
<!--
|
||||
## Upgrading worker nodes
|
||||
|
||||
|
|
Loading…
Reference in New Issue