kubectl plugin机制在Kubernetes 1.14 进入GA状态。
https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/
包管理工具: krew
安装
Make sure that git is installed.
Run this command in your terminal to download and install krew:
1 |
|
- Add $HOME/.krew/bin directory to your PATH environment variable. To do this, update your .bashrc or .zshrc file and append the following line:
1 |
|
and restart your shell.
使用
1 | [root@node1 ~]# kubectl krew update |
体验
1 | [root@node1 ~]# kubectl krew install change-ns |
参考:
https://blog.frognew.com/2019/04/kubernetes-kubectl-plugin.html