From 275e5b13498e04173f703538bff32fc2c801b4d3 Mon Sep 17 00:00:00 2001 From: Ulrich Schreiner Date: Sun, 10 Mar 2019 17:36:51 +0100 Subject: allow kubectl commands against all namespaces (#7637) * allow kubectl commands against all namespaces * enhance the readme too --- plugins/kubectl/README.md | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins/kubectl/README.md') diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index b30f90548..3343f0195 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -14,6 +14,7 @@ plugins=(... kubectl) | Alias | Command | Description | |:--------|:------------------------------------|:-------------------------------------------------------------------------------------------------| | k | `kubectl` | The kubectl command | +| kca | `kubectl --all-namespaces` | The kubectl command targeting all namespaces | | kaf | `kubectl apply -f` | Apply a YML file | | keti | `kubectl exec -ti` | Drop into an interactive terminal on a container | | | | **Manage configuration quickly to switch contexts between local, dev and staging** | -- cgit v1.2.3-70-g09d2 From 978b724c4aeef4113773e27e60fd20af12ca57b8 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 17 Apr 2019 17:23:54 +0200 Subject: kubectl: rename k alias (#7749) This uses `ku` instead of `k` as an alias for kubectl. Fixes #6408 --- plugins/kubectl/README.md | 2 +- plugins/kubectl/kubectl.plugin.zsh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'plugins/kubectl/README.md') diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index 3343f0195..9cd4a369e 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -13,7 +13,7 @@ plugins=(... kubectl) | Alias | Command | Description | |:--------|:------------------------------------|:-------------------------------------------------------------------------------------------------| -| k | `kubectl` | The kubectl command | +| ku | `kubectl` | The kubectl command | | kca | `kubectl --all-namespaces` | The kubectl command targeting all namespaces | | kaf | `kubectl apply -f` | Apply a YML file | | keti | `kubectl exec -ti` | Drop into an interactive terminal on a container | diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index ab7a1a0a4..9a4489fb6 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -10,8 +10,7 @@ if (( $+commands[kubectl] )); then unset __KUBECTL_COMPLETION_FILE fi -# This command is used a LOT both below and in daily life -alias k=kubectl +alias ku=kubectl # Execute a kubectl command against all namespaces alias kca='f(){ kubectl "$@" --all-namespaces; unset -f f; }; f' -- cgit v1.2.3-70-g09d2 From 6da85279eb544c48e85a3714e6fe65f72fd78071 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 29 Apr 2019 15:48:24 +0200 Subject: Revert "kubectl: rename k alias" (#7817) This reverts commit 978b724c4aeef4113773e27e60fd20af12ca57b8 (#7749) See https://github.com/robbyrussell/oh-my-zsh/issues/6408#issuecomment-485718042 and later comments. --- plugins/kubectl/README.md | 2 +- plugins/kubectl/kubectl.plugin.zsh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/kubectl/README.md') diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index 9cd4a369e..3343f0195 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -13,7 +13,7 @@ plugins=(... kubectl) | Alias | Command | Description | |:--------|:------------------------------------|:-------------------------------------------------------------------------------------------------| -| ku | `kubectl` | The kubectl command | +| k | `kubectl` | The kubectl command | | kca | `kubectl --all-namespaces` | The kubectl command targeting all namespaces | | kaf | `kubectl apply -f` | Apply a YML file | | keti | `kubectl exec -ti` | Drop into an interactive terminal on a container | diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 9a4489fb6..ab7a1a0a4 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -10,7 +10,8 @@ if (( $+commands[kubectl] )); then unset __KUBECTL_COMPLETION_FILE fi -alias ku=kubectl +# This command is used a LOT both below and in daily life +alias k=kubectl # Execute a kubectl command against all namespaces alias kca='f(){ kubectl "$@" --all-namespaces; unset -f f; }; f' -- cgit v1.2.3-70-g09d2 From d0e4319a703ab6d1e56a8f615a8d202d3a3753fd Mon Sep 17 00:00:00 2001 From: j-griffith Date: Fri, 3 May 2019 13:22:18 -0600 Subject: Add PersistentVolumeClaim support to kubectl plugin Just add aliases for PVC actions. --- plugins/kubectl/README.md | 6 ++++++ plugins/kubectl/kubectl.plugin.zsh | 8 ++++++++ 2 files changed, 14 insertions(+) (limited to 'plugins/kubectl/README.md') diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index 3343f0195..29dc28d5f 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -89,3 +89,9 @@ plugins=(... kubectl) | keno | `kubectl edit node` | Edit nodes resource from the default editor | | kdno | `kubectl describe node` | Describe node resource in detail | | kdelno | `kubectl delete node` | Delete the node | +| | | **Persistent Volume Claim management** | +| kgpvc | `kubectl get pvc` | List all PVCs | +| kgpvcw | `kgpvc --watch` | After listing/getting the requested object, watch for changes | +| kepvc | `kubectl edit pvc` | Edit pvcs from the default editor | +| kdpvc | `kubectl describe pvc` | Descirbe all pvcs | +| kdelpvc | `kubectl delete pvc` | Delete all pvcs matching passed arguments | diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index ab7a1a0a4..31c87ff82 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -112,3 +112,11 @@ alias kgno='kubectl get nodes' alias keno='kubectl edit node' alias kdno='kubectl describe node' alias kdelno='kubectl delete node' + +# PVC management. +alias kgpvc='kubectl get pvc' +alias kgpvcw='kgpvc --watch' +alias kepvc='kubectl edit pvc' +alias kdpvc='kubectl describe pvc' +alias kdelpvc='kubectl delete pvc' + -- cgit v1.2.3-70-g09d2 From 60736c9f37ccf886291a5995dfc6f7215b0d8b56 Mon Sep 17 00:00:00 2001 From: Miral <13769268+MiralDesai@users.noreply.github.com> Date: Tue, 21 May 2019 23:13:05 +0100 Subject: Add new kubectl alias to list all contexts (#7823) * Add alias to list all contexts * Update readme to include new alias --- plugins/kubectl/README.md | 1 + plugins/kubectl/kubectl.plugin.zsh | 3 +++ 2 files changed, 4 insertions(+) (limited to 'plugins/kubectl/README.md') diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index 3343f0195..0514d8f3f 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -22,6 +22,7 @@ plugins=(... kubectl) | kcsc | `kubectl config set-context` | Set a context entry in kubeconfig | | kcdc | `kubectl config delete-context` | Delete the specified context from the kubeconfig | | kccc | `kubectl config current-context` | Display the current-context | +| kcgc | `kubectl config get-contexts` | List of contexts available | | | **General aliases** | | kdel | `kubectl delete` | Delete resources by filenames, stdin, resources and names, or by resources and label selector | | kdelf | `kubectl delete -f` | Delete a pod using the type and name specified in -f argument | diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index ab7a1a0a4..cf42beaea 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -28,6 +28,9 @@ alias kcsc='kubectl config set-context' alias kcdc='kubectl config delete-context' alias kccc='kubectl config current-context' +# List all contexts +alias kcgc='kubectl config get-contexts' + # General aliases alias kdel='kubectl delete' alias kdelf='kubectl delete -f' -- cgit v1.2.3-70-g09d2 From c105c04b6b1ddb917c12eadacb26c252f44ddfad Mon Sep 17 00:00:00 2001 From: Jason Schwerberg Date: Sat, 15 Jun 2019 11:49:33 -0700 Subject: kubectl: add statefulset aliases (#7826) --- plugins/kubectl/README.md | 9 +++++++++ plugins/kubectl/kubectl.plugin.zsh | 10 ++++++++++ 2 files changed, 19 insertions(+) (limited to 'plugins/kubectl/README.md') diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index 4541c7e92..c0db59362 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -96,3 +96,12 @@ plugins=(... kubectl) | kepvc | `kubectl edit pvc` | Edit pvcs from the default editor | | kdpvc | `kubectl describe pvc` | Descirbe all pvcs | | kdelpvc | `kubectl delete pvc` | Delete all pvcs matching passed arguments | +| | | | +| kgss | `kubectl get statefulset` | List the statefulsets in ps format | +| kgssw | `kgss --watch` | After getting the list of statefulsets, watch for changes | +| kgsswide| `kgss -o wide` | After getting the statefulsets, output in plain-text format with any additional information | +| kess | `kubectl edit statefulset` | Edit statefulset resource from the default editor | +| kdss | `kubectl describe statefulset` | Describe statefulset resource in detail | +| kdelss | `kubectl delete statefulset` | Delete the statefulset | +| ksss | `kubectl scale statefulset` | Scale a statefulset | +| krsss | `kubectl rollout status statefulset`| Check the rollout status of a deployment | diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 5097732db..6c1696d5e 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -96,6 +96,16 @@ alias kgrs='kubectl get rs' alias krh='kubectl rollout history' alias kru='kubectl rollout undo' +# Statefulset management. +alias kgss='kubectl get statefulset' +alias kgssw='kgss --watch' +alias kgsswide='kgss -o wide' +alias kess='kubectl edit statefulset' +alias kdss='kubectl describe statefulset' +alias kdelss='kubectl delete statefulset' +alias ksss='kubectl scale statefulset' +alias krsss='kubectl rollout status statefulset' + # Port forwarding alias kpf="kubectl port-forward" -- cgit v1.2.3-70-g09d2