Merge pull request #25421 from jiaj12/patch-37

Update kubectl-plugins.md
This commit is contained in:
Kubernetes Prow Robot
2020-12-07 01:41:26 -08:00
committed by GitHub
@@ -14,7 +14,6 @@ content_type: task
--> -->
<!-- overview --> <!-- overview -->
<!-- <!--
This guide demonstrates how to install and write extensions for [kubectl](/docs/reference/kubectl/kubectl/). By thinking of core `kubectl` commands as essential building blocks for interacting with a Kubernetes cluster, a cluster administrator can think This guide demonstrates how to install and write extensions for [kubectl](/docs/reference/kubectl/kubectl/). By thinking of core `kubectl` commands as essential building blocks for interacting with a Kubernetes cluster, a cluster administrator can think
of plugins as a means of utilizing these building blocks to create more complex behavior. Plugins extend `kubectl` with new sub-commands, allowing for new and custom features not included in the main distribution of `kubectl`. of plugins as a means of utilizing these building blocks to create more complex behavior. Plugins extend `kubectl` with new sub-commands, allowing for new and custom features not included in the main distribution of `kubectl`.
@@ -52,12 +51,12 @@ the Kubernetes SIG CLI community.
Krew 是一个由 Kubernetes SIG CLI 社区维护的插件管理器。 Krew 是一个由 Kubernetes SIG CLI 社区维护的插件管理器。
<!-- <!--
Kubectl plugins available via the Krew [plugin index](https://index.krew.dev/) Kubectl plugins available via the Krew [plugin index](https://krew.sigs.k8s.io/plugins/)
are not audited for security. You should install and run third-party plugins at your are not audited for security. You should install and run third-party plugins at your
own risk, since they are arbitrary programs running on your machine. own risk, since they are arbitrary programs running on your machine.
--> -->
{{< caution >}} {{< caution >}}
Krew [插件索引](https://index.krew.dev/)所维护的 kubectl 插件并未经过安全性审查。 Krew [插件索引](https://krew.sigs.k8s.io/plugins/) 所维护的 kubectl 插件并未经过安全性审查。
你要了解安装和运行第三方插件的安全风险,因为它们本质上时是一些在你的机器上 你要了解安装和运行第三方插件的安全风险,因为它们本质上时是一些在你的机器上
运行的程序。 运行的程序。
{{< /caution >}} {{< /caution >}}
@@ -69,6 +68,10 @@ Krew [插件索引](https://index.krew.dev/)所维护的 kubectl 插件并未经
Executing this command causes a traversal of all files in your PATH. Any files that are executable, and begin with `kubectl-` will show up *in the order in which they are present in your PATH* in this command's output. Executing this command causes a traversal of all files in your PATH. Any files that are executable, and begin with `kubectl-` will show up *in the order in which they are present in your PATH* in this command's output.
A warning will be included for any files beginning with `kubectl-` that are *not* executable. A warning will be included for any files beginning with `kubectl-` that are *not* executable.
A warning will also be included for any valid plugin files that overlap each other's name. A warning will also be included for any valid plugin files that overlap each other's name.
You can use [Krew](https://krew.dev/) to discover and install `kubectl`
plugins from a community-curated
[plugin index](https://krew.sigs.k8s.io/plugins/).
--> -->
### 发现插件 ### 发现插件
@@ -77,6 +80,9 @@ A warning will also be included for any valid plugin files that overlap each oth
任何以 `kubectl-` 开头的文件如果`不可执行`,都将包含一个警告。 任何以 `kubectl-` 开头的文件如果`不可执行`,都将包含一个警告。
对于任何相同的有效插件文件,都将包含一个警告。 对于任何相同的有效插件文件,都将包含一个警告。
你可以使用 [Krew](https://krew.dev/) 从社区策划的[插件索引](https://krew.sigs.k8s.io/plugins/)
中发现和安装 `kubectl` 插件。
<!-- <!--
#### Limitations #### Limitations
@@ -525,7 +531,7 @@ package it, distribute it and deliver updates to your users.
distribute your plugins. This way, you use a single packaging format for all distribute your plugins. This way, you use a single packaging format for all
target platforms (Linux, Windows, macOS etc) and deliver updates to your users. target platforms (Linux, Windows, macOS etc) and deliver updates to your users.
Krew also maintains a [plugin Krew also maintains a [plugin
index](https://index.krew.dev/) so that other people can index](https://krew.sigs.k8s.io/plugins/) so that other people can
discover your plugin and install it. discover your plugin and install it.
--> -->
### Krew {#distributing-krew} ### Krew {#distributing-krew}
@@ -533,7 +539,7 @@ discover your plugin and install it.
[Krew](https://krew.dev/) 提供了一种对插件进行打包和分发的跨平台方式。 [Krew](https://krew.dev/) 提供了一种对插件进行打包和分发的跨平台方式。
基于这种方式,你会在所有的目标平台(Linux、Windows、macOS 等)使用同一 基于这种方式,你会在所有的目标平台(Linux、Windows、macOS 等)使用同一
种打包形式,包括为用户提供更新。 种打包形式,包括为用户提供更新。
Krew 也维护一个[插件索引(plugin index](https://index.krew.dev/) Krew 也维护一个[插件索引(plugin index](https://krew.sigs.k8s.io/plugins/)
以便其他人能够发现你的插件并安装之。 以便其他人能够发现你的插件并安装之。
<!-- <!--
@@ -552,7 +558,7 @@ platforms for each release.
另一种方式是,你可以使用传统的包管理器(例如 Linux 上 的 `apt``yum` 另一种方式是,你可以使用传统的包管理器(例如 Linux 上 的 `apt``yum`
Windows 上的 Chocolatey、macOs 上的 Homebrew)。 Windows 上的 Chocolatey、macOs 上的 Homebrew)。
只要能够将新的可执行文件放到用户的 `PATH` 路径上某处,这种包管理器就符合需要。 只要能够将新的可执行文件放到用户的 `PATH` 路径上某处,这种包管理器就符合需要。
作为一个插件作者,如果你选择这种方式来纷飞,你就需要自己来管理和更新 作为一个插件作者,如果你选择这种方式来分发,你就需要自己来管理和更新
你的 kubectl 插件的分发包,包括所有平台和所有发行版本。 你的 kubectl 插件的分发包,包括所有平台和所有发行版本。
<!-- <!--
@@ -582,4 +588,3 @@ installs easier.
* 查看 CLI 插件库示例,查看用 Go 编写的插件的[详细示例](https://github.com/kubernetes/sample-cli-plugin) * 查看 CLI 插件库示例,查看用 Go 编写的插件的[详细示例](https://github.com/kubernetes/sample-cli-plugin)
* 如有任何问题,请随时联系 [SIG CLI ](https://github.com/kubernetes/community/tree/master/sig-cli) * 如有任何问题,请随时联系 [SIG CLI ](https://github.com/kubernetes/community/tree/master/sig-cli)
* 了解 [Krew](https://krew.dev/),一个 kubectl 插件管理器。 * 了解 [Krew](https://krew.dev/),一个 kubectl 插件管理器。