K8S Utility No. 6 - kubectl-aliases
This article was last updated on: July 24, 2024 am
Opening
📜 introduction:
- Sharpen knives and do not chop wood by mistake
- Better tools make good work
- Article 1: 《One of the K8S utilities - How to merge multiple kubeconfig?》
- Part 2:K8S Utility II - Terminal UI K9S》
- Part III:K8S Utility 3 - Graphical UI Lens》
- Part IV:K8S Utility IV - kubectl utility plugin》
- Part V:K8S Utility No. 5 - kompose
ahmetb/kubectl-aliases
It isA whole lotThe purpose of kubectl alias is to save time typing a long list of kubectl commands.
The address is here:ahmetb/kubectl-aliases
example
For example:
1 | |
How many are complete, nearly 800… Here are just a few of them:
1 | |
See the full listOver here
Installation
You can download bash/zsh directly.kubectl_aliasesfile and save to yours$HOMEDirectory.
Then add to .bashrc/.zshrc Middle:
1 | |
Abbreviation explained
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
That’s All
🎉🎉🎉
Reference link
K8S Utility No. 6 - kubectl-aliases
https://e-whisper.com/posts/53971/