
常用的几款工具让 Kubernetes 集群上的工作更容易
之前写过一篇 介绍了工具加速云原生 Java 开发。
其实日常工作中在集群上的操作也非常多,今天就来介绍我所使用的工具。
kubectl-alias
使用频率最高的工具,我自己稍微修改了一下,加入了 StatefulSet 的支持。
这个是我的 https://github.com/addozhang/kubectl-aliases,基于 https://github.com/ahmetb/kubectl-aliases。
比如输出某个 pod 的 json,kgpoojson xxx 等同于 kubectl get pod xxx -o json。
结合 jq 使用效果更好 😂。
语法解读
k=kubectlsys=--namespace kube-system
- commands:
g=getd=describerm=deletea:apply -fak:apply -kk:kustomizeex:exec -i -tlo:logs -f
- resources:
po=pod,dep=deployment,ing=ingress,svc=service,cm=configmap,sec=secret,ns=namespace,no=node
- flags:
- output format:
oyaml,ojson,owide all:--allor--all-namespacesdepending on the commandsl:--show-labelsw=-w/--watch
- output format:
- value flags (should be at the end):
n=-n/--namespacef=-f/--filenamel=-l/--selector





