Skip to content

Commit 76b01c2

Browse files
authored
Merge pull request #31154 from tengqm/fix-31153
[zh] Fix markdown error
2 parents ec67f83 + a59221c commit 76b01c2

File tree

1 file changed

+44
-42
lines changed

1 file changed

+44
-42
lines changed

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

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -165,49 +165,49 @@ The following methods exist for installing kubectl on Linux:
165165
### 用原生包管理工具安装 {#install-using-native-package-management}
166166

167167
{{< tabs name="kubectl_install" >}}
168-
{{< tab name="Ubuntu、Debian 或 HypriotOS" codelang="bash" >}}
169-
170-
<!--
171-
1. Update the `apt` package index and install packages needed to use the Kubernetes `apt` repository:
172-
-->
173-
1. 更新 `apt` 包索引,并安装使用 Kubernetes `apt` 仓库锁需要的包
174-
175-
```shell
176-
sudo apt-get update
177-
sudo apt-get install -y apt-transport-https ca-certificates curl
178-
```
179-
180-
<!--
181-
2. Download the Google Cloud public signing key:
182-
-->
183-
2. 下载 Google Cloud 公开签名秘钥:
184-
185-
```shell
186-
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
187-
```
188-
189-
<!--
190-
3. Add the Kubernetes `apt` repository:
191-
-->
192-
3. 添加 Kubernetes `apt` 仓库:
193-
194-
```shell
195-
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
196-
```
197-
198-
<!--
199-
4. Update `apt` package index with the new repository and install kubectl:
200-
-->
201-
4. 更新 `apt` 包索引,使之包含新的仓库并安装 kubectl:
202-
203-
```shell
204-
sudo apt-get update
205-
sudo apt-get install -y kubectl
206-
```
168+
{{% tab name="Ubuntu、Debian 或 HypriotOS" %}}
169+
170+
<!--
171+
1. Update the `apt` package index and install packages needed to use the Kubernetes `apt` repository:
172+
-->
173+
1. 更新 `apt` 包索引,并安装使用 Kubernetes `apt` 仓库所需要的包
174+
175+
```shell
176+
sudo apt-get update
177+
sudo apt-get install -y apt-transport-https ca-certificates curl
178+
```
179+
<!--
180+
2. Download the Google Cloud public signing key:
181+
-->
182+
2. 下载 Google Cloud 公开签名秘钥:
183+
184+
```shell
185+
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
186+
```
187+
188+
<!--
189+
3. Add the Kubernetes `apt` repository:
190+
-->
191+
3. 添加 Kubernetes `apt` 仓库:
192+
193+
```shell
194+
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
195+
```
196+
197+
<!--
198+
4. Update `apt` package index with the new repository and install kubectl:
199+
-->
200+
4. 更新 `apt` 包索引,使之包含新的仓库并安装 kubectl:
201+
202+
```shell
203+
sudo apt-get update
204+
sudo apt-get install -y kubectl
205+
```
206+
{{% /tab %}}
207207

208-
{{< /tab >}}
208+
{{% tab name="基于 Red Hat 的发行版" %}}
209209

210-
{{< tab name="基于 Red Hat 的发行版" codelang="bash" >}}
210+
```shell
211211
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
212212
[kubernetes]
213213
name=Kubernetes
@@ -218,7 +218,9 @@ repo_gpgcheck=1
218218
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
219219
EOF
220220
sudo yum install -y kubectl
221-
{{< /tab >}}
221+
```
222+
223+
{{% /tab %}}
222224
{{< /tabs >}}
223225

224226
<!--

0 commit comments

Comments
 (0)