790712f6f2cae48e8e57239b9ca9e7ab01254253

Author
Michael Favia <michael@favias.org>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Add aliases for kubectl to speed up repetitive commands. (#5856)

Diff

 1diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh
 2index 51ae142a2b352eb5017e0500182274a1d39c698a..88177b5a08826e62d93adb5811f673db97b49dc6 100644
 3--- a/plugins/kubectl/kubectl.plugin.zsh
 4+++ b/plugins/kubectl/kubectl.plugin.zsh
 5@@ -5,3 +5,46 @@
 6 if [ $commands[kubectl] ]; then
 7   source <(kubectl completion zsh)
 8 fi
 9+
10+# This command is used ALOT both below and in daily life
11+alias k=kubectl
12+
13+# Drop into an interactive terminal on a container
14+alias keti='k exec -ti'
15+
16+# Manage configuration quickly to switch contexts between local, dev ad staging.
17+alias kcuc='k config use-context'
18+alias kcsc='k config set-context'
19+alias kcdc='k config delete-context'
20+alias kccc='k config current-context'
21+
22+# Pod management.
23+alias kgp='k get pods'
24+alias klp='k logs pods'
25+alias kep='k edit pods'
26+alias kdp='k describe pods'
27+alias kdelp='k delete pods'
28+
29+# Service management.
30+alias kgs='k get svc'
31+alias kes='k edit svc'
32+alias kds='k describe svc'
33+alias kdels='k delete svc'
34+
35+# Secret management
36+alias kgsec='k get secret'
37+alias kdsec='k describe secret'
38+alias kdelsec='k delete secret'
39+
40+# Deployment management.
41+alias kgd='k get deployment'
42+alias ked='k edit deployment'
43+alias kdd='k describe deployment'
44+alias kdeld='k delete deployment'
45+alias ksd='k scale deployment'
46+alias krsd='k rollout status deployment'
47+
48+# Rollout management.
49+alias kgrs='k get rs'
50+alias krh='k rollout history'
51+alias kru='k rollout undo'