1. kubectl-aliases
kubectl-aliases开源工具是由脚本通过拼接各种kubectl相关元素组成的alias命令别名列表,其中命令别名拼接元素如下:
base | [system?] | [operation] | [resource] | [flags] |
---|---|---|---|---|
k ubectl |
-n=kube-sys tem |
g etd escribe rm :deletelo gsex eca pply |
po dsdep loymentsec reting ressno de svc ns cm |
oyaml ojson owide all w atchf ilel |
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:
--all
or--all-namespaces
depending 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 目录 |
参考:
赞赏一下