Skip to content

Commit

Permalink
Merge pull request #43543 from Community-Programmer/main
Browse files Browse the repository at this point in the history
Updated (zh-cn) Set up kubectl on Linux docs
  • Loading branch information
k8s-ci-robot committed Oct 18, 2023
2 parents afc6afa + b4bd8fc commit bd661f0
Showing 1 changed file with 62 additions and 9 deletions.
71 changes: 62 additions & 9 deletions content/zh-cn/docs/tasks/tools/install-kubectl-linux.md
Expand Up @@ -56,10 +56,10 @@ The following methods exist for installing kubectl on Linux:

{{< tabs name="download_binary_linux" >}}
{{< tab name="x86-64" codelang="bash" >}}
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
{{< /tab >}}
{{< tab name="ARM64" codelang="bash" >}}
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl.sha256"
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"
{{< /tab >}}
{{< /tabs >}}

Expand Down Expand Up @@ -100,10 +100,10 @@ The following methods exist for installing kubectl on Linux:

{{< tabs name="download_checksum_linux" >}}
{{< tab name="x86-64" codelang="bash" >}}
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
{{< /tab >}}
{{< tab name="ARM64" codelang="bash" >}}
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl.sha256"
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"
{{< /tab >}}
{{< /tabs >}}

Expand Down Expand Up @@ -239,17 +239,17 @@ Or use this for detailed view of version:
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
```

{{< note >}}
{{< note >}}
<!--
To upgrade kubectl to another minor release, you'll need to bump the version in
`/etc/apt/sources.list.d/kubernetes.list` before running `apt-get update` and
`apt-get upgrade`. This procedure is described in more detail in
[Changing The Kubernetes Package Repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/).
-->
要升级 kubectl 到别的次要版本,你需要先升级 `/etc/apt/sources.list.d/kubernetes.list` 中的版本,
再运行 `apt-get update` 和 `apt-get upgrade`。
更详细的步骤可以在[更改 Kubernetes 软件包仓库](/zh-cn/docs/tasks/administer-cluster/kubeadm/change-package-repository/)中找到。
{{< /note >}}
要升级 kubectl 到别的次要版本,你需要先升级 `/etc/apt/sources.list.d/kubernetes.list` 中的版本,
再运行 `apt-get update` 和 `apt-get upgrade`。
更详细的步骤可以在[更改 Kubernetes 软件包仓库](/zh-cn/docs/tasks/administer-cluster/kubeadm/change-package-repository/)中找到。
{{< /note >}}

<!--
4. Update `apt` package index, then install kubectl:
Expand Down Expand Up @@ -326,6 +326,59 @@ To upgrade kubectl to another minor release, you'll need to bump the version in
```

{{% /tab %}}

{{% tab name="基于 SUSE 的发行版" %}}
<!--
1. Add the Kubernetes `zypper` repository. If you want to use Kubernetes version
different than {{< param "version" >}}, replace {{< param "version" >}} with
the desired minor version in the command below.
-->

1. 添加 Kubernetes `zypper` 软件源。如果您想使用不同于 {{< param "version" >}} 的 Kubernetes 版本,请在下面的命令中将 {{< param "version" >}} 替换为所需的次要版本。

<!--
```bash
# This overwrites any existing configuration in /etc/zypp/repos.d/kubernetes.repo
cat <<EOF | sudo tee /etc/zypp/repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
EOF
```
-->
```bash
# 这将覆盖 /etc/zypp/repos.d/kubernetes.repo 中的任何现有配置。
cat <<EOF | sudo tee /etc/zypp/repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
EOF
```
{{< note >}}
<!--
To upgrade kubectl to another minor release, you'll need to bump the version in `/etc/zypp/repos.d/kubernetes.repo` before running `zypper update`. This procedure is described in more detail in
[Changing The Kubernetes Package Repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/).
-->
要升级 kubectl 到另一个小版本,你需要先更新 `/etc/zypp/repos.d/kubernetes.repo` 的版本,
再运行 `zypper update`。此过程在[更改 Kubernetes 软件包仓库](/zh-cn/docs/tasks/administer-cluster/kubeadm/change-package-repository/) 中有更详细的描述。
{{< /note >}}

<!--
2. Install kubectl using `zypper`:
-->
2. 使用 `zypper` 安装 kubectl:
```bash
sudo zypper install -y kubectl
```

{{% /tab %}}

{{< /tabs >}}

<!--
Expand Down

0 comments on commit bd661f0

Please sign in to comment.