Merge pull request #35403 from windsonsea/liunxyhf

[zh-cn] resync /tasks/tools/install-kubectl-linux.md
This commit is contained in:
Kubernetes Prow Robot
2022-07-26 07:53:10 -07:00
committed by GitHub
@@ -171,7 +171,7 @@ Or use this for detailed view of version:
### 用原生包管理工具安装 {#install-using-native-package-management} ### 用原生包管理工具安装 {#install-using-native-package-management}
{{< tabs name="kubectl_install" >}} {{< tabs name="kubectl_install" >}}
{{% tab name="Ubuntu、Debian 或 HypriotOS" %}} {{% tab name="基于 Debian 的发行版" %}}
<!-- <!--
1. Update the `apt` package index and install packages needed to use the Kubernetes `apt` repository: 1. Update the `apt` package index and install packages needed to use the Kubernetes `apt` repository:
@@ -180,11 +180,25 @@ Or use this for detailed view of version:
```shell ```shell
sudo apt-get update sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl sudo apt-get install -y ca-certificates curl
``` ```
<!--
If you use Debian 9 (stretch) or earlier you would also need to install `apt-transport-https`:
-->
{{< note >}}
如果你使用 Debian 9(stretch)或更早版本,则你还需要安装 `apt-transport-https`
```shell
sudo apt-get install -y apt-transport-https
```
{{< /note >}}
<!-- <!--
2. Download the Google Cloud public signing key: 2. Download the Google Cloud public signing key:
--> -->
2. 下载 Google Cloud 公开签名秘钥: 2. 下载 Google Cloud 公开签名秘钥:
```shell ```shell
@@ -194,6 +208,7 @@ Or use this for detailed view of version:
<!-- <!--
3. Add the Kubernetes `apt` repository: 3. Add the Kubernetes `apt` repository:
--> -->
3. 添加 Kubernetes `apt` 仓库: 3. 添加 Kubernetes `apt` 仓库:
```shell ```shell
@@ -203,17 +218,18 @@ Or use this for detailed view of version:
<!-- <!--
4. Update `apt` package index with the new repository and install kubectl: 4. Update `apt` package index with the new repository and install kubectl:
--> -->
4. 更新 `apt` 包索引,使之包含新的仓库并安装 kubectl: 4. 更新 `apt` 包索引,使之包含新的仓库并安装 kubectl:
```shell ```shell
sudo apt-get update sudo apt-get update
sudo apt-get install -y kubectl sudo apt-get install -y kubectl
``` ```
{{% /tab %}} {{% /tab %}}
{{% tab name="基于 Red Hat 的发行版" %}} {{< tab name="基于 Red Hat 的发行版" codelang="bash" >}}
```shell
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
[kubernetes] [kubernetes]
name=Kubernetes name=Kubernetes
@@ -223,9 +239,7 @@ gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF EOF
sudo yum install -y kubectl sudo yum install -y kubectl
``` {{< /tab >}}
{{% /tab %}}
{{< /tabs >}} {{< /tabs >}}
<!-- <!--
@@ -352,6 +366,7 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
kubectl-convert: FAILED kubectl-convert: FAILED
sha256sum: WARNING: 1 computed checksum did NOT match sha256sum: WARNING: 1 computed checksum did NOT match
``` ```
{{< note >}} {{< note >}}
<!-- <!--
Download the same version of the binary and checksum. Download the same version of the binary and checksum.