Linux command
krew 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Update the plugin index
kubectl krew update
Search for a plugin
kubectl krew search [keyword]
Install a plugin
kubectl krew install [plugin-name]
List installed plugins
kubectl krew list
Show plugin information
kubectl krew info [plugin-name]
Upgrade all plugins
kubectl krew upgrade
Upgrade a specific plugin
kubectl krew upgrade [plugin-name]
Uninstall a plugin
kubectl krew uninstall [plugin-name]
Add a custom plugin index
kubectl krew index add [index-name] [git-url]
说明
krew is the plugin manager for kubectl, the Kubernetes command-line tool. It simplifies discovering, installing, and managing kubectl plugins across macOS, Linux, and Windows. Krew maintains a central index of available plugins. Use kubectl krew update to sync the local index with the remote repository. The search command finds plugins by name or keyword, and info shows detailed plugin descriptions and usage. Plugins are installed to ~/.krew/bin, which must be in your PATH. After installation, plugins are invoked as kubectl plugin-name (without the "krew" prefix). Krew itself is a kubectl plugin, enabling self-updates via kubectl krew upgrade krew. Custom plugin indexes can be added with kubectl krew index add for private or third-party plugin repositories. Popular plugins include ctx (context switching), ns (namespace switching), neat (clean YAML output), and tree (resource hierarchy visualization).
参数
- -v, --v _level_
- Log level verbosity (0-4).
- -h, --help
- Show help information.
FAQ
What is the krew command used for?
krew is the plugin manager for kubectl, the Kubernetes command-line tool. It simplifies discovering, installing, and managing kubectl plugins across macOS, Linux, and Windows. Krew maintains a central index of available plugins. Use kubectl krew update to sync the local index with the remote repository. The search command finds plugins by name or keyword, and info shows detailed plugin descriptions and usage. Plugins are installed to ~/.krew/bin, which must be in your PATH. After installation, plugins are invoked as kubectl plugin-name (without the "krew" prefix). Krew itself is a kubectl plugin, enabling self-updates via kubectl krew upgrade krew. Custom plugin indexes can be added with kubectl krew index add for private or third-party plugin repositories. Popular plugins include ctx (context switching), ns (namespace switching), neat (clean YAML output), and tree (resource hierarchy visualization).
How do I run a basic krew example?
Run `kubectl krew update` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -v, --v _level_ do in krew?
Log level verbosity (0-4).