Tools and shortcuts for kubectl
- Kubetail - track multiple pods logs https://github.com/johanhaleby/kubetail
brew tap johanhaleby/kubetail && brew install kubetail
- K9s - GUI for kubectl https://k9scli.io/
| # Shortcuts for Kubectl | |
| alias k='kubectl' | |
| alias kgp='kubectl get pods' | |
| alias kgd='kubectl get deployments' | |
| alias kgs='kubectl get services' | |
| alias kgi='kubectl get ingress' | |
| alias kuc='kubectl config use-context' | |
| # context example | |
| alias kdev='kuc dev' | |
| alias kdata='kuc data' | |
| alias kprod='kuc prod' |
Tools and shortcuts for kubectl
brew tap johanhaleby/kubetail && brew install kubetail
| # Add the current context to the info line | |
| # Put this at the end of the file | |
| prompt_kubecontext() { | |
| prompt_segment white black "k8s-`kubectl config current-context`/`kubectl config get-contexts --no-headers | grep '*' | awk '{print $5}'`" | |
| } | |
| ## Main prompt | |
| build_prompt() { | |
| RETVAL=$? | |
| prompt_status | |
| prompt_dir | |
| prompt_git | |
| prompt_kubecontext | |
| prompt_end | |
| } | |
| PROMPT='%{%f%b%k%}$(build_prompt) ' |