/shortk8s

k8s shortcuts

Primary LanguageShell

shortk8s

# kubectl
$ k
# kubectl get
$ kg pod/πŸ”₯
# kubectl describe
$ kd pod/πŸŽ‰
# kubectl logs
$ kl pod/πŸ”₯

fire!
fire!
fire!
# kubectl apply -f
$ kf πŸš’.yaml
deployment.apps/🧯configured
service/πŸš’ configured
pod/πŸ”₯ unchanged
# kubectl exec -it
$ kx pod/πŸ”₯ ls

πŸ’£ πŸ’₯ 🧨 🌢 🍜
# list all namespaces
$ kn

default
defaulter
defaultest
heteronormal
comfortably-numb

# select a namespace for subsequent commands
$ kn comfortably-numb
# list all contexts and show current one
$ ktx

one-context
another-one
* the-selected-one
wish-i-was-selected
dont-select-me

# switch to a context
$ ktx dont-select-me

Installation

zsh

curl -s https://raw.githubusercontent.com/Corei13/shortk8s/master/shortk8s.sh >> ~/.zshrc
source ~/.zshrc

bash

curl -s https://raw.githubusercontent.com/Corei13/shortk8s/master/shortk8s.sh >> ~/.bashrc
source ~/.bashrc