Skip to content

Commit e2b88e3

Browse files
authored
Merge pull request #40991 from my-git9/path-237
[zh-cn] sync install-kubectl-*.md upgrading-windows-nodes.md
2 parents fb5451e + 0ae2357 commit e2b88e3

File tree

4 files changed

+74
-39
lines changed

4 files changed

+74
-39
lines changed

content/zh-cn/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ upgrade the control plane nodes before upgrading your Windows nodes.
4646
1. From the Windows node, upgrade kubeadm:
4747
4848
```powershell
49-
# replace {{< param "fullversion" >}} with your desired version
50-
curl.exe -Lo <path-to-kubeadm.exe> "https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubeadm.exe"
49+
# replace {{< skew currentPatchVersion >}} with your desired version
50+
curl.exe -Lo <path-to-kubeadm.exe> "https://dl.k8s.io/{{< skew currentPatchVersion >}}/bin/windows/amd64/kubeadm.exe"
5151
```
5252
-->
5353
1. 在 Windows 节点上升级 kubeadm:
5454

5555
```powershell
56-
# 将 {{< param "fullversion" >}} 替换为你希望的版本
57-
curl.exe -Lo <kubeadm.exe 路径> "https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubeadm.exe"
56+
# 将 {{< skew currentPatchVersion >}} 替换为你希望的版本
57+
curl.exe -Lo <kubeadm.exe 路径> "https://dl.k8s.io/{{< skew currentPatchVersion >}}/bin/windows/amd64/kubeadm.exe"
5858
```
5959

6060
<!--
@@ -116,7 +116,7 @@ upgrade the control plane nodes before upgrading your Windows nodes.
116116
117117
```powershell
118118
stop-service kubelet
119-
curl.exe -Lo <path-to-kubelet.exe> "https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubelet.exe"
119+
curl.exe -Lo <path-to-kubelet.exe> "https://dl.k8s.io/{{< skew currentPatchVersion >}}/bin/windows/amd64/kubelet.exe"
120120
restart-service kubelet
121121
```
122122
-->
@@ -126,7 +126,7 @@ upgrade the control plane nodes before upgrading your Windows nodes.
126126

127127
```powershell
128128
stop-service kubelet
129-
curl.exe -Lo <kubelet.exe 路径> "https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubelet.exe"
129+
curl.exe -Lo <kubelet.exe 路径> "https://dl.k8s.io/{{< skew currentPatchVersion >}}/bin/windows/amd64/kubelet.exe"
130130
restart-service kubelet
131131
```
132132

@@ -135,15 +135,15 @@ upgrade the control plane nodes before upgrading your Windows nodes.
135135
136136
```powershell
137137
stop-service kube-proxy
138-
curl.exe -Lo <path-to-kube-proxy.exe> "https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kube-proxy.exe"
138+
curl.exe -Lo <path-to-kube-proxy.exe> "https://dl.k8s.io/{{< skew currentPatchVersion >}}/bin/windows/amd64/kube-proxy.exe"
139139
restart-service kube-proxy
140140
```
141141
-->
142142
2. 在 Windows 节点上升级并重启 kube-proxy:
143143

144144
```powershell
145145
stop-service kube-proxy
146-
curl.exe -Lo <kube-proxy.exe 路径> "https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kube-proxy.exe"
146+
curl.exe -Lo <kube-proxy.exe 路径> "https://dl.k8s.io/{{< skew currentPatchVersion >}}/bin/windows/amd64/kube-proxy.exe"
147147
restart-service kube-proxy
148148
```
149149

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

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,38 @@ The following methods exist for installing kubectl on Linux:
6262
-->
6363
1. 用以下命令下载最新发行版:
6464

65-
```bash
65+
{{< tabs name="download_binary_linux" >}}
66+
{{< tab name="x86-64" codelang="bash" >}}
6667
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
67-
```
68+
{{< /tab >}}
69+
{{< tab name="ARM64" codelang="bash" >}}
70+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"
71+
{{< /tab >}}
72+
{{< /tabs >}}
6873

6974
{{< note >}}
7075
<!--
7176
To download a specific version, replace the `$(curl -L -s https://dl.k8s.io/release/stable.txt)`
7277
portion of the command with the specific version.
7378
74-
For example, to download version {{< param "fullversion" >}} on Linux, type:
79+
For example, to download version {{< skew currentPatchVersion >}} on Linux x86-64, type:
7580
-->
7681
如需下载某个指定的版本,请用指定版本号替换该命令的这一部分:
7782
`$(curl -L -s https://dl.k8s.io/release/stable.txt)`
7883

79-
例如,要在 Linux 中下载 {{< param "fullversion" >}} 版本,请输入:
84+
例如,要在 Linux x86-64 中下载 {{< skew currentPatchVersion >}} 版本,请输入:
85+
86+
```bash
87+
curl -LO https://dl.k8s.io/release/v{{< skew currentPatchVersion >}}/bin/linux/amd64/kubectl
88+
```
89+
90+
<!--
91+
And for Linux ARM64, type:
92+
-->
93+
对于 Linux ARM64 来说,请输入:
8094

8195
```bash
82-
curl -LO https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/linux/amd64/kubectl
96+
curl -LO https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/linux/arm64/kubectl
8397
```
8498
{{< /note >}}
8599

@@ -92,9 +106,14 @@ The following methods exist for installing kubectl on Linux:
92106

93107
下载 kubectl 校验和文件:
94108

95-
```bash
109+
{{< tabs name="download_checksum_linux" >}}
110+
{{< tab name="x86-64" codelang="bash" >}}
96111
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
97-
```
112+
{{< /tab >}}
113+
{{< tab name="ARM64" codelang="bash" >}}
114+
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl.sha256"
115+
{{< /tab >}}
116+
{{< /tabs >}}
98117

99118
<!--
100119
Validate the kubectl binary against the checksum file:
@@ -170,17 +189,23 @@ Or use this for detailed view of version:
170189
The above command will generate a warning:
171190
-->
172191
上面的命令会产生一个警告:
192+
173193
```
174194
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.
175195
```
196+
176197
<!--
177198
You can ignore this warning. You are only checking the version of `kubectl` that you
178199
have installed.
179200
-->
180201
你可以忽略这个警告。你只检查你所安装的 `kubectl` 的版本。
181202
{{< /note >}}
182203

204+
<!--
205+
Or use this for detailed view of version:
206+
-->
183207
或者使用如下命令来查看版本的详细信息:
208+
184209
```cmd
185210
kubectl version --client --output=yaml
186211
```
@@ -202,10 +227,10 @@ Or use this for detailed view of version:
202227
sudo apt-get update
203228
sudo apt-get install -y ca-certificates curl
204229
```
230+
205231
<!--
206232
If you use Debian 9 (stretch) or earlier you would also need to install `apt-transport-https`:
207-
-->
208-
233+
-->
209234
如果你使用 Debian 9(stretch)或更早版本,则你还需要安装 `apt-transport-https`
210235

211236
```shell
@@ -242,6 +267,7 @@ Or use this for detailed view of version:
242267
sudo apt-get update
243268
sudo apt-get install -y kubectl
244269
```
270+
245271
{{< note >}}
246272
<!--
247273
In releases older than Debian 12 and Ubuntu 22.04, `/etc/apt/keyrings` does not exist by default.
@@ -355,9 +381,15 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
355381
-->
356382
1. 用以下命令下载最新发行版:
357383

358-
```bash
384+
{{< tabs name="download_binary_linux" >}}
385+
{{< tab name="x86-64" codelang="bash" >}}
359386
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl-convert"
360-
```
387+
{{< /tab >}}
388+
{{< tab name="ARM64" codelang="bash" >}}
389+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"
390+
{{< /tab >}}
391+
{{< /tabs >}}
392+
361393
<!--
362394
1. Validate the binary (optional)
363395
@@ -367,9 +399,14 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
367399

368400
下载 kubectl-convert 校验和文件:
369401

370-
```bash
402+
{{< tabs name="download_convert_checksum_linux" >}}
403+
{{< tab name="x86-64" codelang="bash" >}}
371404
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl-convert.sha256"
372-
```
405+
{{< /tab >}}
406+
{{< tab name="ARM64" codelang="bash" >}}
407+
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl-convert.sha256"
408+
{{< /tab >}}
409+
{{< /tabs >}}
373410

374411
<!--
375412
Validate the kubectl-convert binary against the checksum file:

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ The following methods exist for installing kubectl on macOS:
8686
To download a specific version, replace the `$(curl -L -s https://dl.k8s.io/release/stable.txt)`
8787
portion of the command with the specific version.
8888
89-
For example, to download version {{< param "fullversion" >}} on Intel macOS, type:
89+
For example, to download version {{< skew currentPatchVersion >}} on Intel macOS, type:
9090
-->
9191
如果需要下载某个指定的版本,用该指定版本号替换掉命令的这个部分:`$(curl -L -s https://dl.k8s.io/release/stable.txt)`
92-
例如:要为 Intel macOS 系统下载 {{< param "fullversion" >}} 版本,则输入:
92+
例如:要为 Intel macOS 系统下载 {{< skew currentPatchVersion >}} 版本,则输入:
9393

9494
```bash
95-
curl -LO "https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/darwin/amd64/kubectl"
95+
curl -LO "https://dl.k8s.io/release/v{{< skew currentPatchVersion >}}/bin/darwin/amd64/kubectl"
9696
```
9797

9898
<!--
@@ -101,7 +101,7 @@ The following methods exist for installing kubectl on macOS:
101101
对于 Apple Silicon 版本的 macOS,输入:
102102

103103
```bash
104-
curl -LO "https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/darwin/arm64/kubectl"
104+
curl -LO "https://dl.k8s.io/release/v{{< skew currentPatchVersion >}}/bin/darwin/arm64/kubectl"
105105
```
106106
{{< /note >}}
107107

@@ -131,6 +131,7 @@ The following methods exist for installing kubectl on macOS:
131131
```bash
132132
echo "$(cat kubectl.sha256) kubectl" | shasum -a 256 --check
133133
```
134+
134135
<!--
135136
If valid, the output is:
136137
-->

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

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,21 @@ The following methods exist for installing kubectl on Windows:
5757
<!--
5858
1. Download the [latest release {{< param "fullversion" >}}](https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/windows/amd64/kubectl.exe).
5959
-->
60-
1. 下载[最新发行版 {{< param "fullversion" >}}](https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/windows/amd64/kubectl.exe)。
60+
<!--
61+
1. Download the latest {{< skew currentVersion >}} patch release:
62+
[kubectl {{< skew currentPatchVersion >}}](https://dl.k8s.io/release/v{{< skew currentPatchVersion >}}/bin/windows/amd64/kubectl.exe).
63+
-->
64+
65+
1. 下载最新补丁版 {{< skew currentVersion >}}:
66+
[kubectl {{< skew currentPatchVersion >}}](https://dl.k8s.io/release/v{{< skew currentPatchVersion >}}/bin/windows/amd64/kubectl.exe)。
6167

6268
<!--
6369
Or if you have `curl` installed, use this command:
6470
-->
6571
如果你已安装了 `curl`,也可以使用此命令:
6672

6773
```powershell
68-
curl.exe -LO "https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/windows/amd64/kubectl.exe"
74+
curl.exe -LO "https://dl.k8s.io/release/v{{< skew currentPatchVersion >}}/bin/windows/amd64/kubectl.exe"
6975
```
7076

7177
{{< note >}}
@@ -86,7 +92,7 @@ The following methods exist for installing kubectl on Windows:
8692
下载 `kubectl` 校验和文件:
8793

8894
```powershell
89-
curl.exe -LO "https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubectl.exe.sha256"
95+
curl.exe -LO "https://dl.k8s.io/v{{< skew currentPatchVersion >}}/bin/windows/amd64/kubectl-convert.exe.sha256"
9096
```
9197

9298
<!--
@@ -154,15 +160,6 @@ The following methods exist for installing kubectl on Windows:
154160
kubectl version --client --output=yaml
155161
```
156162

157-
<!--
158-
1. After installing the plugin, clean up the installation files:
159-
-->
160-
5. 安装插件后,清理安装文件:
161-
162-
```powershell
163-
del kubectl.exe kubectl.exe.sha256
164-
```
165-
166163
{{< note >}}
167164
<!--
168165
[Docker Desktop for Windows](https://docs.docker.com/docker-for-windows/#kubernetes)
@@ -301,7 +298,7 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
301298
1. 用以下命令下载最新发行版:
302299

303300
```powershell
304-
curl.exe -LO "https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/windows/amd64/kubectl-convert.exe"
301+
curl.exe -LO "https://dl.k8s.io/release/v{{< skew currentPatchVersion >}}/bin/windows/amd64/kubectl-convert.exe"
305302
```
306303

307304
<!--
@@ -315,7 +312,7 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
315312
下载 `kubectl-convert` 校验和文件:
316313

317314
```powershell
318-
curl.exe -LO "https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubectl-convert.exe.sha256"
315+
curl.exe -LO "https://dl.k8s.io/v{{< skew currentPatchVersion >}}/bin/windows/amd64/kubectl.exe.sha256"
319316
```
320317

321318
<!--

0 commit comments

Comments
 (0)