600 kubectl aliases for DevOps Ninjas

While I was playing with kube-shell, an integrated shell for Kubernetes CLI, i ran into kubectl-aliases on github, a completely different and smart approach of simplifying kubectl commands.

These condensed single-word bash aliases are created by Ahmet Alp Balkan and you can read more about it on Ahmet’s blog here.

Basically, his syntax is as follows:

Aliases are generated by his script here. Logic is very simple, but i find it very useful for everyday use.

Here are few examples:

alias kdall='kubectl describe --all-namespaces'
alias kgpoall='kubectl get pods --all-namespaces'
alias kgnoowide='kubectl get nodes -o=wide'
alias kgnsowide='kubectl get namespaces -o=wide'
alias krmall='kubectl delete --all'
alias ksysrmall='kubectl --namespace=kube-system delete --all'
alias krmpoall='kubectl delete pods --all'

You can download all 600 aliases here.

Please share:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.