8260005dc7bba42d82edd8e606c10d9e7a9bb26e
- Author
- Joaquín Moreira <joaquinscript@gmail.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
kubectl: add alias to list pods by namespace (#8604)
Diff
1diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md
2index c0db5936256e42334510ef3241cf23bdc1fe78cf..ee05a8af119b40e589f0e0e57e06cc7c6b67544f 100644
3--- a/plugins/kubectl/README.md
4+++ b/plugins/kubectl/README.md
5@@ -33,7 +33,8 @@ plugins=(... kubectl)
6 | kep | `kubectl edit pods` | Edit pods from the default editor |
7 | kdp | `kubectl describe pods` | Describe all pods |
8 | kdelp | `kubectl delete pods` | Delete all pods matching passed arguments |
9-| kgpl | `kgp -l` | Get pod by label. Example: `kgpl "app=myapp" -n myns` |
10+| kgpl | `kgp -l` | Get pods by label. Example: `kgpl "app=myapp" -n myns` |
11+| kgpn | `kgp -n` | Get pods by namespace. Example: `kgpn kube-system` |
12 | | | **Service management** |
13 | kgs | `kubectl get svc` | List all services in ps output format |
14 | kgsw | `kgs --watch` | After listing all services, watch for changes |
15diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh
16index 92688c53c04f8324012606b02e8dd0d9385b3382..647d029c191426a451919f7811f2896727ba4d9e 100644
17--- a/plugins/kubectl/kubectl.plugin.zsh
18+++ b/plugins/kubectl/kubectl.plugin.zsh
19@@ -47,6 +47,9 @@ alias kdelp='kubectl delete pods'
20 # get pod by label: kgpl "app=myapp" -n myns
21 alias kgpl='kgp -l'
22
23+# get pod by namespace: kgpn kube-system"
24+alias kgpn='kgp -n'
25+
26 # Service management.
27 alias kgs='kubectl get svc'
28 alias kgsa='kubectl get svc --all-namespaces'