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:
Jérémy 2024-09-05 19:57:11 +02:00 committed by GitHub
parent e6380085f3
commit bc42097900
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 122 additions and 122 deletions

View File

@ -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 |
@ -102,12 +104,12 @@ plugins=(... kubectl)
| | | **StatefulSets management** |
| 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 |
| 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 |
| krsss | `kubectl rollout status statefulset` | Check the rollout status of a deployment |
| | | **Service Accounts management** |
| kdsa | `kubectl describe sa` | Describe a service account in details |
| kdelsa | `kubectl delete sa` | Delete the service account |

View File

@ -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'