1. kubectl-aliases
kubectl-aliases开源工具是由脚本通过拼接各种kubectl相关元素组成的alias命令别名列表,其中命令别名拼接元素如下:
| base | [system?] | [operation] | [resource] | [flags] |
|---|---|---|---|---|
kubectl |
-n=kube-system |
getdescribe rm:deletelogsexecapply |
podsdeploymentsecretingressnode svcns cm |
oyaml ojsonowide allwatchfilel |
k=kubectl- sys=
--namespace kube-system
- sys=
- commands:
- g=
get - d=
describe - rm=
delete - a:
apply -f - ex:
exec -i -t - lo:
logs -f
- g=
- resources:
- po=
pod - dep=
deployment - ing=
ingress - svc=
service - cm=
configmap - sec=
secret - ns=
namespace - no=
node
- po=
- flags:
- output format: oyaml, ojson, owide
- all:
--allor--all-namespacesdepending on the command - sl:
--show-labels - w=
-w/--watch
- value flags (should be at the end):
- f=
-f/--filename - l=
-l/--selector
- f=
2. 示例
1 | # 示例1 |
alias get示例:
1 | alias k='kubectl' |
3. 安装
1 | # 将 .kubectl_aliases下载到 home 目录 |
参考:
赞赏一下
支付宝打赏
微信打赏