kubectl 插件

https://kubernetes.io/zh-cn/docs/reference/kubectl/

kubectl 支持使用任何编程语言定义插件,插件位置必须要在$PATH 路径中,必须要有可执行权限,命令必须以kubectl 为前缀

示例:

编写脚本并放在PATH 中

root@master01:~# cat /usr/local/bin/kubectl-hello
#!/bin/bash

echo hello world

添加执行权限

chmod +x /usr/local/bin/kubectl-hello

调用插件

root@master01:~# kubectl hello
hello world
posted @ 2023-10-26 09:23  mingtian是吧  阅读(4)  评论(0编辑  收藏  举报