feat(kubectl): add aliases for get events (#13147)

This commit is contained in:
mm503 2025-05-29 02:33:01 -05:00 committed by GitHub
parent 6ef47526f8
commit 658240f498
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 122 additions and 118 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 |
@ -26,6 +26,8 @@ plugins=(... kubectl)
| | | **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 |
| kge | `kubectl get events --sort-by=".lastTimestamp"` | Get events (sorted by timestamp) |
| kgew | `kubectl get events --watch --sort-by=".lastTimestamp"` | Get events and watch as they occur (sorted by timestamp) |
| | | **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` |

View File

@ -36,6 +36,8 @@ alias kcgc='kubectl config get-contexts'
# General aliases
alias kdel='kubectl delete'
alias kdelf='kubectl delete -f'
alias kge='kubectl get events --sort-by=".lastTimestamp"'
alias kgew='kubectl get events --sort-by=".lastTimestamp" --watch'
# Pod management.
alias kgp='kubectl get pods'