From 275e5b13498e04173f703538bff32fc2c801b4d3 Mon Sep 17 00:00:00 2001 From: Ulrich Schreiner Date: Sun, 10 Mar 2019 17:36:51 +0100 Subject: [PATCH] allow kubectl commands against all namespaces (#7637) * allow kubectl commands against all namespaces * enhance the readme too --- plugins/kubectl/README.md | 1 + plugins/kubectl/kubectl.plugin.zsh | 3 +++ 2 files changed, 4 insertions(+) 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** | diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index d388d6543..ab7a1a0a4 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -13,6 +13,9 @@ fi # 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' + # Apply a YML file alias kaf='kubectl apply -f'