@@ -42,7 +42,7 @@ The following methods exist for installing kubectl on Windows:
42
42
43
43
在 Windows 系统中安装 kubectl 有如下几种方法:
44
44
45
- <!--
45
+ <!--
46
46
- [Install kubectl binary with curl on Windows](#install-kubectl-binary-with-curl-on-windows)
47
47
- [Install on Windows using Chocolatey, Scoop, or winget](#install-nonstandard-package-tools)
48
48
-->
@@ -55,7 +55,7 @@ The following methods exist for installing kubectl on Windows:
55
55
### 用 curl 在 Windows 上安装 kubectl {#install-kubectl-binary-with-curl-on-windows}
56
56
57
57
<!--
58
- 1. Download the [latest release {{< param "fullversion" >}}](https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/windows/amd64/kubectl.exe).
58
+ 1. Download the [latest release {{< skew currentPatchVersion >}}](https://dl.k8s.io/release/v {{< skew currentPatchVersion >}}/bin/windows/amd64/kubectl.exe).
59
59
-->
60
60
<!--
61
61
1. Download the latest {{< skew currentVersion >}} patch release:
@@ -88,7 +88,7 @@ The following methods exist for installing kubectl on Windows:
88
88
Download the `kubectl` checksum file:
89
89
-->
90
90
2 . 验证该可执行文件(可选步骤)
91
-
91
+
92
92
下载 ` kubectl ` 校验和文件:
93
93
94
94
``` powershell
@@ -120,7 +120,7 @@ The following methods exist for installing kubectl on Windows:
120
120
$(Get-FileHash -Algorithm SHA256 .\kubectl.exe).Hash -eq $(Get-Content .\kubectl.exe.sha256)
121
121
```
122
122
123
- <!--
123
+ <!--
124
124
1. Append or prepend the `kubectl` binary folder to your `PATH` environment variable.
125
125
126
126
1. Test to ensure the version of `kubectl` is the same as downloaded:
@@ -161,7 +161,7 @@ The following methods exist for installing kubectl on Windows:
161
161
```
162
162
163
163
{{< note >}}
164
- <!--
164
+ <!--
165
165
[Docker Desktop for Windows](https://docs.docker.com/docker-for-windows/#kubernetes)
166
166
adds its own version of `kubectl` to `PATH`. If you have installed Docker Desktop before,
167
167
you may need to place your `PATH` entry before the one added by the Docker Desktop
@@ -204,7 +204,7 @@ installer or remove the Docker Desktop's `kubectl`.
204
204
{{% /tab %}}
205
205
{{< /tabs >}}
206
206
207
- <!--
207
+ <!--
208
208
1. Test to ensure the version you installed is up-to-date:
209
209
-->
210
210
2 . 测试一下,确保安装的是最新版本:
@@ -213,7 +213,7 @@ installer or remove the Docker Desktop's `kubectl`.
213
213
kubectl version --client
214
214
```
215
215
216
- <!--
216
+ <!--
217
217
1. Navigate to your home directory:
218
218
-->
219
219
3 . 导航到你的 home 目录:
@@ -223,7 +223,7 @@ installer or remove the Docker Desktop's `kubectl`.
223
223
cd ~
224
224
```
225
225
226
- <!--
226
+ <!--
227
227
1. Create the `.kube` directory:
228
228
-->
229
229
4 . 创建目录 ` .kube ` :
@@ -241,7 +241,7 @@ installer or remove the Docker Desktop's `kubectl`.
241
241
cd .kube
242
242
```
243
243
244
- <!--
244
+ <!--
245
245
1. Configure kubectl to use a remote Kubernetes cluster:
246
246
-->
247
247
6 . 配置 kubectl,以接入远程的 Kubernetes 集群:
@@ -251,20 +251,20 @@ installer or remove the Docker Desktop's `kubectl`.
251
251
```
252
252
253
253
{{< note >}}
254
- <!--
254
+ <!--
255
255
Edit the config file with a text editor of your choice, such as Notepad.
256
256
-->
257
257
编辑配置文件,你需要先选择一个文本编辑器,比如 Notepad。
258
258
{{< /note >}}
259
259
260
- <!--
260
+ <!--
261
261
## Verify kubectl configuration
262
262
-->
263
263
## 验证 kubectl 配置 {#verify-kubectl-configration}
264
264
265
265
{{< include "included/verify-kubectl.md" >}}
266
266
267
- <!--
267
+ <!--
268
268
## Optional kubectl configurations and plugins
269
269
270
270
### Enable shell autocompletion
@@ -324,7 +324,7 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
324
324
- Using Command Prompt to manually compare `CertUtil`'s output to the checksum file downloaded:
325
325
-->
326
326
- 用提示的命令对 ` CertUtil ` 的输出和下载的校验和文件进行手动比较。
327
-
327
+
328
328
``` cmd
329
329
CertUtil -hashfile kubectl-convert.exe SHA256
330
330
type kubectl-convert.exe.sha256
@@ -336,7 +336,7 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
336
336
-->
337
337
338
338
- 使用 PowerShell `-eq` 操作使验证自动化,获得 `True` 或者 `False` 的结果:
339
-
339
+
340
340
```powershell
341
341
$($(CertUtil -hashfile .\kubectl-convert.exe SHA256)[1] -replace " ", "") -eq $(type .\kubectl-convert.exe.sha256)
342
342
```
0 commit comments