2018-05-26 18:25:47 +02:00
|
|
|
if (( $+commands[kubectl] )); then
|
|
|
|
__KUBECTL_COMPLETION_FILE="${ZSH_CACHE_DIR}/kubectl_completion"
|
2016-08-15 02:30:55 +02:00
|
|
|
|
2018-05-26 18:25:47 +02:00
|
|
|
if [[ ! -f $__KUBECTL_COMPLETION_FILE ]]; then
|
|
|
|
kubectl completion zsh >! $__KUBECTL_COMPLETION_FILE
|
|
|
|
fi
|
2018-05-20 14:46:27 +02:00
|
|
|
|
2018-05-26 18:25:47 +02:00
|
|
|
[[ -f $__KUBECTL_COMPLETION_FILE ]] && source $__KUBECTL_COMPLETION_FILE
|
2018-05-20 14:46:27 +02:00
|
|
|
|
2018-05-26 18:25:47 +02:00
|
|
|
unset __KUBECTL_COMPLETION_FILE
|
2016-08-15 02:30:55 +02:00
|
|
|
fi
|
2017-11-07 17:00:14 +01:00
|
|
|
|
|
|
|
# This command is used ALOT both below and in daily life
|
|
|
|
alias k=kubectl
|
|
|
|
|
2018-03-09 17:14:09 +01:00
|
|
|
# Apply a YML file
|
|
|
|
alias kaf='k apply -f'
|
|
|
|
|
2017-11-07 17:00:14 +01:00
|
|
|
# Drop into an interactive terminal on a container
|
|
|
|
alias keti='k exec -ti'
|
|
|
|
|
|
|
|
# Manage configuration quickly to switch contexts between local, dev ad staging.
|
|
|
|
alias kcuc='k config use-context'
|
|
|
|
alias kcsc='k config set-context'
|
|
|
|
alias kcdc='k config delete-context'
|
|
|
|
alias kccc='k config current-context'
|
|
|
|
|
|
|
|
# Pod management.
|
|
|
|
alias kgp='k get pods'
|
|
|
|
alias kep='k edit pods'
|
|
|
|
alias kdp='k describe pods'
|
|
|
|
alias kdelp='k delete pods'
|
|
|
|
|
|
|
|
# Service management.
|
|
|
|
alias kgs='k get svc'
|
|
|
|
alias kes='k edit svc'
|
|
|
|
alias kds='k describe svc'
|
|
|
|
alias kdels='k delete svc'
|
|
|
|
|
2018-04-28 16:55:46 +02:00
|
|
|
# Ingress management
|
|
|
|
alias kgi='k get ingress'
|
|
|
|
alias kei='k edit ingress'
|
|
|
|
alias kdi='k describe ingress'
|
|
|
|
alias kdeli='k delete ingress'
|
|
|
|
|
2017-11-07 17:00:14 +01:00
|
|
|
# Secret management
|
|
|
|
alias kgsec='k get secret'
|
|
|
|
alias kdsec='k describe secret'
|
|
|
|
alias kdelsec='k delete secret'
|
|
|
|
|
|
|
|
# Deployment management.
|
|
|
|
alias kgd='k get deployment'
|
|
|
|
alias ked='k edit deployment'
|
|
|
|
alias kdd='k describe deployment'
|
|
|
|
alias kdeld='k delete deployment'
|
|
|
|
alias ksd='k scale deployment'
|
|
|
|
alias krsd='k rollout status deployment'
|
|
|
|
|
|
|
|
# Rollout management.
|
|
|
|
alias kgrs='k get rs'
|
|
|
|
alias krh='k rollout history'
|
|
|
|
alias kru='k rollout undo'
|
2018-03-09 17:12:42 +01:00
|
|
|
|
|
|
|
# Logs
|
|
|
|
alias kl='k logs'
|
|
|
|
alias klf='k logs -f'
|