Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated (zh-cn) Set up kubectl on Linux docs #43543

Merged
merged 2 commits into from
Oct 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 62 additions & 9 deletions content/zh-cn/docs/tasks/tools/install-kubectl-linux.md
Original file line number Diff line number Diff line change
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" >}} 替换为所需的次要版本。
Community-Programmer marked this conversation as resolved.
Show resolved Hide resolved

<!--
```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:
Community-Programmer marked this conversation as resolved.
Show resolved Hide resolved
```bash
sudo zypper install -y kubectl
Community-Programmer marked this conversation as resolved.
Show resolved Hide resolved
```

{{% /tab %}}

{{< /tabs >}}

<!--
Expand Down