[zh] sync install-kubectl-windows.md

This commit is contained in:
Michael 2022-10-18 07:45:15 +08:00
parent 4c6003344a
commit 0698a29104
1 changed files with 11 additions and 13 deletions

View File

@ -35,7 +35,6 @@ v{{< skew currentVersionAddMinor 0 >}} 和 v{{< skew currentVersionAddMinor 1 >}
The following methods exist for installing kubectl on Windows:
-->
## 在 Windows 上安装 kubectl {#install-kubectl-on-windows}
在 Windows 系统中安装 kubectl 有如下几种方法:
@ -49,7 +48,6 @@ The following methods exist for installing kubectl on Windows:
<!--
### Install kubectl binary with curl on Windows
-->
### 用 curl 在 Windows 上安装 kubectl {#install-kubectl-binary-with-curl-on-windows}
<!--
@ -63,7 +61,7 @@ The following methods exist for installing kubectl on Windows:
如果你已安装了 `curl`,也可以使用此命令:
```powershell
curl -LO "https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/windows/amd64/kubectl.exe"
curl.exe -LO "https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/windows/amd64/kubectl.exe"
```
{{< note >}}
@ -83,7 +81,7 @@ The following methods exist for installing kubectl on Windows:
下载 `kubectl` 校验和文件:
```powershell
curl -LO "https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubectl.exe.sha256"
curl.exe -LO "https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubectl.exe.sha256"
```
<!--
@ -123,17 +121,18 @@ The following methods exist for installing kubectl on Windows:
```cmd
kubectl version --client
```
或者使用下面命令来查看版本的详细信息:
```cmd
kubectl version --client --output=yaml
```
{{< note >}}
<!--
[Docker Desktop for Windows](https://docs.docker.com/docker-for-windows/#kubernetes) adds its own version of `kubectl` to `PATH`.
If you have installed Docker Desktop before, you may need to place your `PATH` entry before the one added by the Docker Desktop installer or remove the Docker Desktop's `kubectl`.
-->
{{< note >}}
[Windows 版的 Docker Desktop](https://docs.docker.com/docker-for-windows/#kubernetes)
将其自带版本的 `kubectl` 添加到 `PATH`
如果你之前安装过 Docker Desktop可能需要把此 `PATH` 条目置于 Docker Desktop 安装的条目之前,
@ -148,7 +147,7 @@ If you have installed Docker Desktop before, you may need to place your `PATH` e
<!--
1. To install kubectl on Windows you can use either [Chocolatey](https://chocolatey.org) package manager or [Scoop](https://scoop.sh) command-line installer.
-->
1. 要在 Windows 上安装 kubectl你可以使用包管理器 [Chocolatey](https://chocolatey.org)
1. 要在 Windows 上安装 kubectl你可以使用包管理器 [Chocolatey](https://chocolatey.org)
或是命令行安装器 [Scoop](https://scoop.sh)。
{{< tabs name="kubectl_win_install" >}}
@ -164,7 +163,6 @@ If you have installed Docker Desktop before, you may need to place your `PATH` e
{{% /tab %}}
{{< /tabs >}}
<!--
1. Test to ensure the version you installed is up-to-date:
-->
@ -196,7 +194,7 @@ If you have installed Docker Desktop before, you may need to place your `PATH` e
<!--
1. Change to the `.kube` directory you just created:
-->
5. 切换到新创建的目录 `.kube`
5. 切换到新创建的目录 `.kube`
```powershell
cd .kube
@ -211,10 +209,10 @@ If you have installed Docker Desktop before, you may need to place your `PATH` e
New-Item config -type file
```
{{< note >}}
<!--
Edit the config file with a text editor of your choice, such as Notepad.
-->
{{< note >}}
编辑配置文件,你需要先选择一个文本编辑器,比如 Notepad。
{{< /note >}}
@ -248,7 +246,7 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
<!--
### Install `kubectl convert` plugin
-->
### 安装 `kubectl convert` 插件
### 安装 `kubectl convert` 插件 {#install-kubectl-convert-plugin}
{{< include "included/kubectl-convert-overview.md" >}}
@ -258,7 +256,7 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
1. 用以下命令下载最新发行版:
```powershell
curl -LO "https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/windows/amd64/kubectl-convert.exe"
curl.exe -LO "https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/windows/amd64/kubectl-convert.exe"
```
<!--
@ -272,7 +270,7 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
下载 `kubectl-convert` 校验和文件:
```powershell
curl -LO "https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubectl-convert.exe.sha256"
curl.exe -LO "https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubectl-convert.exe.sha256"
```
<!--
@ -307,7 +305,7 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
-->
3. 将 `kubectl-convert` 二进制文件夹附加或添加到你的 `PATH` 环境变量中。
4. 验证插件是否安装成功
4. 验证插件是否安装成功
```shell
kubectl convert --help