Skip to content

Commit 576c5c2

Browse files
Updated (zh-cn) Set up kubectl on Linux docs
1 parent c716e3e commit 576c5c2

File tree

1 file changed

+54
-9
lines changed

1 file changed

+54
-9
lines changed

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

Lines changed: 54 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,51 @@ 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+
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.
333+
-->
334+
335+
1. 添加 Kubernetes `zypper` 软件源。如果您想使用不同于 {{< param "version" >}} 的 Kubernetes 版本,请在下面的命令中将 {{< param "version" >}} 替换为所需的次要版本。
336+
337+
<!--
338+
# This overwrites any existing configuration in /etc/zypp/repos.d/kubernetes.repo
339+
cat <<EOF | sudo tee /etc/zypp/repos.d/kubernetes.repo
340+
[kubernetes]
341+
name=Kubernetes
342+
baseurl=https://pkgs.k8s.io/core:/stable:/v1.28/rpm/
343+
enabled=1
344+
gpgcheck=1
345+
gpgkey=https://pkgs.k8s.io/core:/stable:/v1.28/rpm/repodata/repomd.xml.key
346+
EOF
347+
-->
348+
```shell
349+
# 这将覆盖 /etc/zypp/repos.d/kubernetes.repo 中的任何现有配置。
350+
cat <<EOF | sudo tee /etc/zypp/repos.d/kubernetes.repo
351+
[kubernetes]
352+
name=Kubernetes
353+
baseurl=https://pkgs.k8s.io/core:/stable:/v1.28/rpm/
354+
enabled=1
355+
gpgcheck=1
356+
gpgkey=https://pkgs.k8s.io/core:/stable:/v1.28/rpm/repodata/repomd.xml.key
357+
EOF
358+
```
359+
{{< note >}}
360+
<!--
361+
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
362+
[Changing The Kubernetes Package Repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/).
363+
-->
364+
要升级 kubectl 到另一个小版本,您需要在运行 `zypper update` 之前提升 `/etc/zypp/repos.d/kubernetes.repo`中的版本。此过程在《更改 Kubernetes 软件包存储库》中有更详细的描述。
365+
{{< /note >}}
366+
367+
2. 使用 `zypper` 安装 kubectl:
368+
```bash
369+
sudo zypper install -y kubectl
370+
371+
372+
{{% /tab %}}
373+
329374
{{< /tabs >}}
330375
331376
<!--

0 commit comments

Comments
 (0)