@@ -56,10 +56,10 @@ The following methods exist for installing kubectl on Linux:
56
56
57
57
{{< tabs name="download_binary_linux" >}}
58
58
{{< 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 "
59
+ curl -LO "https://dl.k8s.io/release/$ (curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256 "
60
60
{{< /tab >}}
61
61
{{< 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 "
62
+ curl -LO "https://dl.k8s.io/release/$ (curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl.sha256 "
63
63
{{< /tab >}}
64
64
{{< /tabs >}}
65
65
@@ -241,7 +241,10 @@ Or use this for detailed view of version:
241
241
242
242
{{< note >}}
243
243
<!--
244
- 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/).
244
+ To upgrade kubectl to another minor release, you'll need to bump the version in
245
+ `/etc/apt/sources.list.d/kubernetes.list` before running `apt-get update` and
246
+ `apt-get upgrade`. This procedure is described in more detail in
247
+ [Changing The Kubernetes Package Repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/).
245
248
-->
246
249
要升级 kubectl 到别的次要版本,你需要先升级 ` /etc/apt/sources.list.d/kubernetes.list ` 中的版本,
247
250
再运行 ` apt-get update ` 和 ` apt-get upgrade ` 。
@@ -279,30 +282,30 @@ In releases older than Debian 12 and Ubuntu 22.04, `/etc/apt/keyrings` does not
279
282
1 . 添加 Kubernetes 的 ` yum ` 仓库。如果你想使用 {{< param "version" >}} 之外的 Kubernetes 版本,
280
283
将下面命令中的 {{< param "version" >}} 替换为所需的次要版本。
281
284
282
- <!--
283
- ```bash
284
- # This overwrites any existing configuration in /etc/yum.repos.d/kubernetes.repo
285
- cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
286
- [kubernetes]
287
- name=Kubernetes
288
- baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
289
- enabled=1
290
- gpgcheck=1
291
- gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
292
- EOF
293
- ```
294
- -->
295
- ``` bash
296
- # 这会覆盖 /etc/yum.repos.d/kubernetes.repo 中现存的所有配置
297
- cat << EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
298
- [kubernetes]
299
- name=Kubernetes
300
- baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
301
- enabled=1
302
- gpgcheck=1
303
- gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
304
- EOF
305
- ```
285
+ <!--
286
+ ```bash
287
+ # This overwrites any existing configuration in /etc/yum.repos.d/kubernetes.repo
288
+ cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
289
+ [kubernetes]
290
+ name=Kubernetes
291
+ baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
292
+ enabled=1
293
+ gpgcheck=1
294
+ gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
295
+ EOF
296
+ ```
297
+ -->
298
+ ``` bash
299
+ # 这会覆盖 /etc/yum.repos.d/kubernetes.repo 中现存的所有配置
300
+ cat << EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
301
+ [kubernetes]
302
+ name=Kubernetes
303
+ baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
304
+ enabled=1
305
+ gpgcheck=1
306
+ gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
307
+ EOF
308
+ ` ` `
306
309
307
310
{{< note > }}
308
311
< ! --
@@ -314,13 +317,13 @@ To upgrade kubectl to another minor release, you'll need to bump the version in
314
317
{{< /note >}}
315
318
316
319
<!--
317
- 1 . Install kubectl using `yum`:
320
+ 2 . Install kubectl using `yum`:
318
321
-->
319
- 1 . 使用 ` yum ` 安装 kubectl:
322
+ 2 . 使用 `yum` 安装 kubectl:
320
323
321
- ``` bash
322
- sudo yum install -y kubectl
323
- ```
324
+ ```bash
325
+ sudo yum install -y kubectl
326
+ ```
324
327
325
328
{{% /tab %}}
326
329
{{< /tabs >}}
@@ -430,10 +433,10 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
430
433
431
434
{{< tabs name="download_convert_checksum_linux" >}}
432
435
{{< tab name="x86-64" codelang="bash" >}}
433
- curl -LO "https://dl.k8s.io/$ (curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl-convert.sha256 "
436
+ curl -LO "https://dl.k8s.io/release/ $(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl-convert.sha256"
434
437
{{< /tab >}}
435
438
{{< tab name="ARM64" codelang="bash" >}}
436
- curl -LO "https://dl.k8s.io/$ (curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl-convert.sha256 "
439
+ curl -LO "https://dl.k8s.io/release/ $(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl-convert.sha256"
437
440
{{< /tab >}}
438
441
{{< /tabs >}}
439
442
0 commit comments