mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-29 04:53:17 +02:00
Add an error message if the binary isn't found and a few more commonly used commands.
This commit is contained in:
parent
c3b072eace
commit
0bf70d670a
1 changed files with 60 additions and 42 deletions
|
|
@ -3,8 +3,9 @@
|
||||||
# Author: https://github.com/pstadler
|
# Author: https://github.com/pstadler
|
||||||
|
|
||||||
if [ $commands[kubectl] ]; then
|
if [ $commands[kubectl] ]; then
|
||||||
|
|
||||||
|
# Let kubectl load up the autocompletions
|
||||||
source <(kubectl completion zsh)
|
source <(kubectl completion zsh)
|
||||||
fi
|
|
||||||
|
|
||||||
# This command is used ALOT both below and in daily life
|
# This command is used ALOT both below and in daily life
|
||||||
alias k=kubectl
|
alias k=kubectl
|
||||||
|
|
@ -13,6 +14,7 @@ alias k=kubectl
|
||||||
alias keti='k exec -ti'
|
alias keti='k exec -ti'
|
||||||
|
|
||||||
# Manage configuration quickly to switch contexts between local, dev ad staging.
|
# Manage configuration quickly to switch contexts between local, dev ad staging.
|
||||||
|
alias kcgc='k config get-contexts'
|
||||||
alias kcuc='k config use-context'
|
alias kcuc='k config use-context'
|
||||||
alias kcsc='k config set-context'
|
alias kcsc='k config set-context'
|
||||||
alias kcdc='k config delete-context'
|
alias kcdc='k config delete-context'
|
||||||
|
|
@ -20,6 +22,7 @@ alias kccc='k config current-context'
|
||||||
|
|
||||||
# Pod management.
|
# Pod management.
|
||||||
alias kgp='k get pods'
|
alias kgp='k get pods'
|
||||||
|
alias kgpa='k get pods --all-namespaces'
|
||||||
alias klp='k logs pods'
|
alias klp='k logs pods'
|
||||||
alias kep='k edit pods'
|
alias kep='k edit pods'
|
||||||
alias kdp='k describe pods'
|
alias kdp='k describe pods'
|
||||||
|
|
@ -27,6 +30,7 @@ alias kdelp='k delete pods'
|
||||||
|
|
||||||
# Service management.
|
# Service management.
|
||||||
alias kgs='k get svc'
|
alias kgs='k get svc'
|
||||||
|
alias kgsa='k get svc --all-namespaces'
|
||||||
alias kes='k edit svc'
|
alias kes='k edit svc'
|
||||||
alias kds='k describe svc'
|
alias kds='k describe svc'
|
||||||
alias kdels='k delete svc'
|
alias kdels='k delete svc'
|
||||||
|
|
@ -48,3 +52,17 @@ alias krsd='k rollout status deployment'
|
||||||
alias kgrs='k get rs'
|
alias kgrs='k get rs'
|
||||||
alias krh='k rollout history'
|
alias krh='k rollout history'
|
||||||
alias kru='k rollout undo'
|
alias kru='k rollout undo'
|
||||||
|
|
||||||
|
# Node management
|
||||||
|
alias kgn='k get nodes'
|
||||||
|
alias kdn='k describe nodes'
|
||||||
|
|
||||||
|
# Port Forwarding
|
||||||
|
alias kpf='k port-forward'
|
||||||
|
|
||||||
|
else
|
||||||
|
RED='\033[0;31m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
printf "${RED}kubectl plugin loaded in .oh-my-zsh but cannot find kubectl binary in current PATH:\n $PATH${NC}" 1>&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue