kubectl shortnames for bash alias

In our DevOps life, we use a lot of CLI tools and one of the most popular orchestrations tool that we use is Kubernetes.

To get a full list of your resources, including their shortnames, use the command below:

kubectl api-resources
### ADD this in bashrc or bash_profile
# User specific aliases and functions for kubectl
alias ll="ls -al"
alias k="kubectl"
alias d="describe"
alias g="get"
alias kg="kubectl get"
alias kd="kubectl describe"
alias klf="kubectl logs -f"
alias kccc="kubectl config current-context"
alias kcuc="kubectl config use-context"
alias kcgc="kubectl config get-contexts"
alias kgns="kubectl get ns"
alias kgp="kubectl get pods"
alias kgsec="kubectl get secrets"
alias kgcm="kubectl get cm"

Reference link from Kubernetes docs: https://kubernetes.io/docs/reference/kubectl/

0 Shares:
Leave a Reply

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

You May Also Like