kubectl插件的包管理器-Krew

介绍

Krew是kubectl命令行工具的插件管理器。它类似于apt、brew等工具。Krew帮助用户发现插件,并在服务器上安装和管理插件。Krew还可以帮助kubectl插件的开发者轻松地在多个平台上打包和分发插件,并通过Krew的集中式插件库使它们可以被发现。
目前有194个kubectl插件分布在Krew上。
Krew适用于所有主要平台,如macOS、Linux和Windows。

安装

关于kerw的安装,可以参考官网文档[1]进行。

使用帮助

[root@localhost ~]# kubectl krew
krew is the kubectl plugin manager.
You can invoke krew through kubectl: "kubectl krew [command]..."

Usage:
  kubectl krew [command]

Available Commands:
  completion  generate the autocompletion script for the specified shell
  help        Help about any command
  index       Manage custom plugin indexes
  info        Show information about an available plugin
  install     Install kubectl plugins
  list        List installed kubectl plugins
  search      Discover kubectl plugins
  uninstall   Uninstall plugins
  update      Update the local copy of the plugin index
  upgrade     Upgrade installed plugins to newer versions
  version     Show krew version and diagnostics

Flags:
  -h, --help      help for krew
  -v, --v Level   number for the log level verbosity

Use "kubectl krew [command] --help" for more information about a command.

常用操作

更新本地插件索引

[root@localhost ~]# kubectl krew update
Updated the local copy of plugin index.

列出所有可用的插件

[root@localhost ~]# kubectl krew search
NAME                            DESCRIPTION                                         INSTALLED
access-matrix                   Show an RBAC access matrix for server resources     no
advise-psp                      Suggests PodSecurityPolicies for cluster.           no
auth-proxy                      Authentication proxy to a pod or service            no
[...]

安装插件

kubectl krew install ice

卸载插件

kubectl krew uninstall ice

升级插件

kubectl krew upgrade

更多使用说明请参考用户文档[2]
参考资料:
[1]:https://krew.sigs.k8s.io/docs/user-guide/setup/install/
[2]:https://krew.sigs.k8s.io/docs/user-guide/

你可能感兴趣的:(kubectl插件的包管理器-Krew)