Skip to content

Instantly share code, notes, and snippets.

@etenzy
Last active February 8, 2022 10:58
Show Gist options
  • Save etenzy/ab36787e6002fadcb2beb3779d4ae2e4 to your computer and use it in GitHub Desktop.
Save etenzy/ab36787e6002fadcb2beb3779d4ae2e4 to your computer and use it in GitHub Desktop.
CK{AD,A,S} Shell setup
# in most cases this would be already in the bashrc
alias k=kubectl
source <(kubectl completion bash)
complete -F __start_kubectl k
# these exports only work with bash
export do="--dry-run=client -o yaml"
# usage: k run example nginx $do > example.yaml
export now="--force --grace-period 0"
# usage: k delete pod example $now
# aliases (no completion)
alias ktmp="kubectl run tmp --restart=Never --rm -i "
# usage: ktmp --image nginx -- curl example.com
alias kns="kubectl config set-context --current --namespace "
# usage: kns project-x
set tabstop=2
set shiftwidth=2
set expandtab
source ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment