mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-12 20:21:02 +01:00
feat(kubectl): show labels in aliases kgpsl
(get pod) and kgnosl
(get node) (#12612)
Co-authored-by: Marc Cornellà <marc@mcornella.com>
This commit is contained in:
parent
e6380085f3
commit
bc42097900
2 changed files with 122 additions and 122 deletions
|
@ -12,7 +12,7 @@ plugins=(... kubectl)
|
|||
## Aliases
|
||||
|
||||
| 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 |
|
||||
|
@ -28,13 +28,14 @@ plugins=(... kubectl)
|
|||
| kdelf | `kubectl delete -f` | Delete a pod using the type and name specified in -f argument |
|
||||
| | | **Pod management** |
|
||||
| kgp | `kubectl get pods` | List all pods in ps output format |
|
||||
| kgpl | `kgp -l` | Get pods by label. Example: `kgpl "app=myapp" -n myns` |
|
||||
| kgpn | `kgp -n` | Get pods by namespace. Example: `kgpn kube-system` |
|
||||
| kgpsl | `kubectl get pods --show-labels` | List all pods in ps output format with labels |
|
||||
| kgpw | `kgp --watch` | After listing/getting the requested object, watch for changes |
|
||||
| kgpwide | `kgp -o wide` | Output in plain-text format with any additional information. For pods, the node name is included |
|
||||
| kep | `kubectl edit pods` | Edit pods from the default editor |
|
||||
| kdp | `kubectl describe pods` | Describe all pods |
|
||||
| kdelp | `kubectl delete pods` | Delete all pods matching passed arguments |
|
||||
| kgpl | `kgp -l` | Get pods by label. Example: `kgpl "app=myapp" -n myns` |
|
||||
| kgpn | `kgp -n` | Get pods by namespace. Example: `kgpn kube-system` |
|
||||
| | | **Service management** |
|
||||
| kgs | `kubectl get svc` | List all services in ps output format |
|
||||
| kgsw | `kgs --watch` | After listing all services, watch for changes |
|
||||
|
@ -90,6 +91,7 @@ plugins=(... kubectl)
|
|||
| kcp | `kubectl cp` | Copy files and directories to and from containers |
|
||||
| | | **Node management** |
|
||||
| kgno | `kubectl get nodes` | List the nodes in ps output format |
|
||||
| kgnosl | `kubectl get nodes --show-labels` | List the nodes in ps output format with labels |
|
||||
| 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 |
|
||||
|
|
|
@ -39,6 +39,9 @@ alias kdelf='kubectl delete -f'
|
|||
|
||||
# Pod management.
|
||||
alias kgp='kubectl get pods'
|
||||
alias kgpl='kgp -l'
|
||||
alias kgpn='kgp -n'
|
||||
alias kgpsl='kubectl get pods --show-labels'
|
||||
alias kgpa='kubectl get pods --all-namespaces'
|
||||
alias kgpw='kgp --watch'
|
||||
alias kgpwide='kgp -o wide'
|
||||
|
@ -47,12 +50,6 @@ alias kdp='kubectl describe pods'
|
|||
alias kdelp='kubectl delete pods'
|
||||
alias kgpall='kubectl get pods --all-namespaces -o wide'
|
||||
|
||||
# get pod by label: kgpl "app=myapp" -n myns
|
||||
alias kgpl='kgp -l'
|
||||
|
||||
# get pod by namespace: kgpn kube-system"
|
||||
alias kgpn='kgp -n'
|
||||
|
||||
# Service management.
|
||||
alias kgs='kubectl get svc'
|
||||
alias kgsa='kubectl get svc --all-namespaces'
|
||||
|
@ -144,6 +141,7 @@ alias kcp='kubectl cp'
|
|||
|
||||
# Node Management
|
||||
alias kgno='kubectl get nodes'
|
||||
alias kgnosl='kubectl get nodes --show-labels'
|
||||
alias keno='kubectl edit node'
|
||||
alias kdno='kubectl describe node'
|
||||
alias kdelno='kubectl delete node'
|
||||
|
|
Loading…
Reference in a new issue