@@ -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 "
59+ curl -LO "https://dl.k8s.io/release/$ (curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256 "
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 "
62+ curl -LO "https://dl.k8s.io/release/$ (curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl.sha256 "
6363 {{< /tab >}}
6464 {{< /tabs >}}
6565
@@ -241,7 +241,10 @@ Or use this for detailed view of version:
241241
242242 {{< note >}}
243243 <!--
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/).
245248 -->
246249 要升级 kubectl 到别的次要版本,你需要先升级 ` /etc/apt/sources.list.d/kubernetes.list ` 中的版本,
247250 再运行 ` 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
2792821 . 添加 Kubernetes 的 ` yum ` 仓库。如果你想使用 {{< param "version" >}} 之外的 Kubernetes 版本,
280283 将下面命令中的 {{< param "version" >}} 替换为所需的次要版本。
281284
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+ ` ` `
306309
307310{{< note > }}
308311< ! --
@@ -314,13 +317,13 @@ To upgrade kubectl to another minor release, you'll need to bump the version in
314317{{< /note >}}
315318
316319<!--
317- 1 . Install kubectl using `yum`:
320+ 2 . Install kubectl using `yum`:
318321-->
319- 1 . 使用 ` yum ` 安装 kubectl:
322+ 2 . 使用 `yum` 安装 kubectl:
320323
321- ``` bash
322- sudo yum install -y kubectl
323- ```
324+ ```bash
325+ sudo yum install -y kubectl
326+ ```
324327
325328{{% /tab %}}
326329{{< /tabs >}}
@@ -430,10 +433,10 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
430433
431434 {{< tabs name="download_convert_checksum_linux" >}}
432435 {{< 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"
434437 {{< /tab >}}
435438 {{< 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"
437440 {{< /tab >}}
438441 {{< /tabs >}}
439442
0 commit comments