From af1709cfdc57bce75f641f5ea8171ae97d6f246c Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 13 Aug 2018 22:07:07 +0200 Subject: kubectl: use kubectl to define aliases This prevents conflicts with other utilities named k (see #6408). --- plugins/kubectl/kubectl.plugin.zsh | 64 +++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'plugins/kubectl/kubectl.plugin.zsh') diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index f91475b6c..a4a6b1b88 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -14,53 +14,53 @@ fi alias k=kubectl # Apply a YML file -alias kaf='k apply -f' +alias kaf='kubectl apply -f' # Drop into an interactive terminal on a container -alias keti='k exec -ti' +alias keti='kubectl 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' +alias kcuc='kubectl config use-context' +alias kcsc='kubectl config set-context' +alias kcdc='kubectl config delete-context' +alias kccc='kubectl 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' +alias kgp='kubectl get pods' +alias kep='kubectl edit pods' +alias kdp='kubectl describe pods' +alias kdelp='kubectl delete pods' # Service management. -alias kgs='k get svc' -alias kes='k edit svc' -alias kds='k describe svc' -alias kdels='k delete svc' +alias kgs='kubectl get svc' +alias kes='kubectl edit svc' +alias kds='kubectl describe svc' +alias kdels='kubectl delete svc' # Ingress management -alias kgi='k get ingress' -alias kei='k edit ingress' -alias kdi='k describe ingress' -alias kdeli='k delete ingress' +alias kgi='kubectl get ingress' +alias kei='kubectl edit ingress' +alias kdi='kubectl describe ingress' +alias kdeli='kubectl delete ingress' # Secret management -alias kgsec='k get secret' -alias kdsec='k describe secret' -alias kdelsec='k delete secret' +alias kgsec='kubectl get secret' +alias kdsec='kubectl describe secret' +alias kdelsec='kubectl 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' +alias kgd='kubectl get deployment' +alias ked='kubectl edit deployment' +alias kdd='kubectl describe deployment' +alias kdeld='kubectl delete deployment' +alias ksd='kubectl scale deployment' +alias krsd='kubectl rollout status deployment' # Rollout management. -alias kgrs='k get rs' -alias krh='k rollout history' -alias kru='k rollout undo' +alias kgrs='kubectl get rs' +alias krh='kubectl rollout history' +alias kru='kubectl rollout undo' # Logs -alias kl='k logs' -alias klf='k logs -f' +alias kl='kubectl logs' +alias klf='kubectl logs -f' -- cgit v1.2.3-70-g09d2 From 39221643b06e5c5ee884978787b08c74de850ec2 Mon Sep 17 00:00:00 2001 From: Dan O'Brien Date: Wed, 29 Aug 2018 14:51:50 -0400 Subject: Add aliases for kubectl nodes (#7093) * Add aliases for kubectl nodes * change to have 'o' at the end. My teammate noticed there's no namespacing shortcuts either and will be doing a PR on them with kgna. --- plugins/kubectl/kubectl.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins/kubectl/kubectl.plugin.zsh') diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index a4a6b1b88..492e6ff00 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -64,3 +64,9 @@ alias kru='kubectl rollout undo' # Logs alias kl='kubectl logs' alias klf='kubectl logs -f' + +# Node Management +alias kgno='kubectl get nodes' +alias keno='kubectl edit node' +alias kdno='kubectl describe node' +alias kdelno='kubectl delete node' -- cgit v1.2.3-70-g09d2 From e7c9bf8d669bd4ec0c63041e37adb17f3fc1b567 Mon Sep 17 00:00:00 2001 From: Vinod Damle Date: Wed, 29 Aug 2018 14:56:30 -0400 Subject: kubectl: add alias for `kubectl cp` (#7068) --- plugins/kubectl/kubectl.plugin.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins/kubectl/kubectl.plugin.zsh') diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 492e6ff00..197ada37b 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -65,8 +65,11 @@ alias kru='kubectl rollout undo' alias kl='kubectl logs' alias klf='kubectl logs -f' +# File copy +alias kcp='kubectl cp' + # Node Management alias kgno='kubectl get nodes' alias keno='kubectl edit node' alias kdno='kubectl describe node' -alias kdelno='kubectl delete node' +alias kdelno='kubectl delete node' \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 94df5038632df5453ffd0ff4b6367399bc5fe7e8 Mon Sep 17 00:00:00 2001 From: Serhii Kuts Date: Wed, 29 Aug 2018 22:01:40 +0300 Subject: Update kubectl.plugin.zsh (#6636) --- plugins/kubectl/kubectl.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins/kubectl/kubectl.plugin.zsh') diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 197ada37b..680ec1a8c 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -31,6 +31,9 @@ alias kep='kubectl edit pods' alias kdp='kubectl describe pods' alias kdelp='kubectl delete pods' +# get pod by label: kgpl "app=myapp" -n myns +alias kgpl='function _kgpl(){ label=$1; shift; kgp -l $label $*; };_kgpl' + # Service management. alias kgs='kubectl get svc' alias kes='kubectl edit svc' @@ -61,6 +64,9 @@ alias kgrs='kubectl get rs' alias krh='kubectl rollout history' alias kru='kubectl rollout undo' +# Port forwarding +alias kpf="k port-forward" + # Logs alias kl='kubectl logs' alias klf='kubectl logs -f' -- cgit v1.2.3-70-g09d2