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_aliases
file and save to yours$HOME
Directory.
Then add to .bashrc/.zshrc
Middle:
1 |
|
Abbreviation explained
k
=kubectl
sys
=--namespace kube-system
- commands:
g
=get
d
=describe
rm
=delete
a
:apply -f
ak
:apply -k
k
:kustomize
ex
:exec -i -t
lo
: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
:--all
or--all-namespaces
depending on the commandsl
:--show-labels
w
=-w/--watch
- output format:
- value flags (should be at the end):
n
=-n/--namespace
f
=-f/--filename
l
=-l/--selector
That’s All
🎉🎉🎉
Reference link
K8S Utility No. 6 - kubectl-aliases
https://e-whisper.com/posts/53971/