Creating alias for Kubectl
alias k=kubectl
k get pods
This will persist until you log out. To save this alias, add it to your .bashrc
or .profile
file.
Creating a alias to set the context
kubectl config set-context --current --namespace foo
alias kubens='kubectl config set-context --current --namespace '
alias kns=kubens
Reference: https://medium.com/james-reads-public-cloud-technology-blog/3-basic-kubernetes-shortcuts-for-faster-command-line-kung-fu-5c041295ea78