mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-16 10:50:07 +00:00
69 lines
1.6 KiB
Bash
69 lines
1.6 KiB
Bash
# Autocompletion for kubectl, the command line interface for Kubernetes
|
|
#
|
|
# Author: https://github.com/pstadler
|
|
|
|
KUBECTL_COMPLETION_FILENAME="$TMPPREFIX-kubectl-completion-zsh"
|
|
|
|
if [[ ! -f "$KUBECTL_COMPLETION_FILENAME" ]]
|
|
then
|
|
kubectl completion zsh > "$KUBECTL_COMPLETION_FILENAME"
|
|
fi
|
|
|
|
if [ $commands[kubectl] ]; then
|
|
source "$KUBECTL_COMPLETION_FILENAME"
|
|
fi
|
|
|
|
# This command is used ALOT both below and in daily life
|
|
alias k=kubectl
|
|
|
|
# Apply a YML file
|
|
alias kaf='k apply -f'
|
|
|
|
# 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'
|
|
|
|
# Ingress management
|
|
alias kgi='k get ingress'
|
|
alias kei='k edit ingress'
|
|
alias kdi='k describe ingress'
|
|
alias kdeli='k delete ingress'
|
|
|
|
# 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'
|
|
|
|
# Logs
|
|
alias kl='k logs'
|
|
alias klf='k logs -f'
|