Skip to content

Commit bd661f0

Browse files
authored
Merge pull request #43543 from Community-Programmer/main
Updated (zh-cn) Set up kubectl on Linux docs
2 parents afc6afa + b4bd8fc commit bd661f0

File tree

1 file changed

+62
-9
lines changed

1 file changed

+62
-9
lines changed

content/zh-cn/docs/tasks/tools/install-kubectl-linux.md

Lines changed: 62 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ The following methods exist for installing kubectl on Linux:
5656

5757
{{< tabs name="download_binary_linux" >}}
5858
{{< tab name="x86-64" codelang="bash" >}}
59-
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
59+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
6060
{{< /tab >}}
6161
{{< tab name="ARM64" codelang="bash" >}}
62-
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl.sha256"
62+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"
6363
{{< /tab >}}
6464
{{< /tabs >}}
6565

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

101101
{{< tabs name="download_checksum_linux" >}}
102102
{{< tab name="x86-64" codelang="bash" >}}
103-
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
103+
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
104104
{{< /tab >}}
105105
{{< tab name="ARM64" codelang="bash" >}}
106-
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl.sha256"
106+
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"
107107
{{< /tab >}}
108108
{{< /tabs >}}
109109

@@ -239,17 +239,17 @@ Or use this for detailed view of version:
239239
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
240240
```
241241

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

254254
<!--
255255
4. Update `apt` package index, then install kubectl:
@@ -326,6 +326,59 @@ To upgrade kubectl to another minor release, you'll need to bump the version in
326326
```
327327
328328
{{% /tab %}}
329+
330+
{{% tab name="基于 SUSE 的发行版" %}}
331+
<!--
332+
1. Add the Kubernetes `zypper` repository. If you want to use Kubernetes version
333+
different than {{< param "version" >}}, replace {{< param "version" >}} with
334+
the desired minor version in the command below.
335+
-->
336+
337+
1. 添加 Kubernetes `zypper` 软件源。如果您想使用不同于 {{< param "version" >}} 的 Kubernetes 版本,请在下面的命令中将 {{< param "version" >}} 替换为所需的次要版本。
338+
339+
<!--
340+
```bash
341+
# This overwrites any existing configuration in /etc/zypp/repos.d/kubernetes.repo
342+
cat <<EOF | sudo tee /etc/zypp/repos.d/kubernetes.repo
343+
[kubernetes]
344+
name=Kubernetes
345+
baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
346+
enabled=1
347+
gpgcheck=1
348+
gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
349+
EOF
350+
```
351+
-->
352+
```bash
353+
# 这将覆盖 /etc/zypp/repos.d/kubernetes.repo 中的任何现有配置。
354+
cat <<EOF | sudo tee /etc/zypp/repos.d/kubernetes.repo
355+
[kubernetes]
356+
name=Kubernetes
357+
baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
358+
enabled=1
359+
gpgcheck=1
360+
gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
361+
EOF
362+
```
363+
{{< note >}}
364+
<!--
365+
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
366+
[Changing The Kubernetes Package Repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/).
367+
-->
368+
要升级 kubectl 到另一个小版本,你需要先更新 `/etc/zypp/repos.d/kubernetes.repo` 的版本,
369+
再运行 `zypper update`。此过程在[更改 Kubernetes 软件包仓库](/zh-cn/docs/tasks/administer-cluster/kubeadm/change-package-repository/) 中有更详细的描述。
370+
{{< /note >}}
371+
372+
<!--
373+
2. Install kubectl using `zypper`:
374+
-->
375+
2. 使用 `zypper` 安装 kubectl:
376+
```bash
377+
sudo zypper install -y kubectl
378+
```
379+
380+
{{% /tab %}}
381+
329382
{{< /tabs >}}
330383
331384
<!--

0 commit comments

Comments
 (0)