feat: plugin to list all resources by namespace (#3619)

* Plugin to list all resources by namespace (closes #3618)

* add get-all-namespace-resources.yaml plugin to plugins table
mine
Mattis 2025-10-10 15:05:25 +02:00 committed by GitHub
parent e762cc6d90
commit b97885ce0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 48 additions and 0 deletions

View File

@ -14,6 +14,7 @@ Following is an example of some plugin files in this directory. Other files are
| dive.yaml | Dive image layers | containers | d | [Dive](https://github.com/wagoodman/dive) | | dive.yaml | Dive image layers | containers | d | [Dive](https://github.com/wagoodman/dive) |
| dup.yaml | Duplicate, edit and Debug resources | all | Shift-d/e/v | [dup](https://github.com/vash/dup) | | dup.yaml | Duplicate, edit and Debug resources | all | Shift-d/e/v | [dup](https://github.com/vash/dup) |
| external-secrets.yaml | Refresh external/push-secrets | externalsecrets/pushsecrets | Shift-R | [External Secrets](https://external-secrets.io) | | external-secrets.yaml | Refresh external/push-secrets | externalsecrets/pushsecrets | Shift-R | [External Secrets](https://external-secrets.io) |
| get-all-namespace-resources.yaml | List all namespace resources (using standard kubectl) | all | m | [kubectl](https://kubernetes.io/docs/tasks/tools/) |
| get-all.yaml | get all resources in a namespace | all | g | [Krew](https://krew.sigs.k8s.io/), [ketall](https://github.com/corneliusweig/ketall/) | | get-all.yaml | get all resources in a namespace | all | g | [Krew](https://krew.sigs.k8s.io/), [ketall](https://github.com/corneliusweig/ketall/) |
| helm-diff.yaml | Diff with previous revision / current revision | helm/history | Shift-D/Q | [helm-diff](https://github.com/databus23/helm-diff) | | helm-diff.yaml | Diff with previous revision / current revision | helm/history | Shift-D/Q | [helm-diff](https://github.com/databus23/helm-diff) |
| job-suspend.yaml | Suspends a running cronjob | cronjobs | Ctrl-s | | | job-suspend.yaml | Suspends a running cronjob | cronjobs | Ctrl-s | |

View File

@ -0,0 +1,47 @@
plugins:
get-all-resources-by-selected-namespace:
shortCut: m
confirm: false
description: List all resources of the selected namespace
scopes:
- namespaces
command: sh
background: false
args:
- -c
- 'for r in $(kubectl api-resources --verbs=list --namespaced -o name); do out=$(kubectl get --ignore-not-found --show-kind -n $NAME $r 2>/dev/null); if [ -n "$out" ]; then echo "$out"; echo ""; fi; done | less'
get-all-resources-in-current-namespace:
shortCut: m
confirm: false
description: List all resources of the current namespace
scopes:
- configmaps
- controllerrevisions
- daemonsets
- deployments
- endpoints
- endpointslices
- events
- horizontalpodautoscalers
- ingresses
- jobs
- leases
- limitranges
- networkpolicies
- persistentvolumeclaims
- poddisruptionbudgets
- pods
- replicasets
- replicationcontrollers
- resourcequotas
- rolebindings
- roles
- secrets
- serviceaccounts
- services
- statefulsets
command: sh
background: false
args:
- -c
- 'for r in $(kubectl api-resources --verbs=list --namespaced -o name); do out=$(kubectl get --ignore-not-found --show-kind -n $NAMESPACE $r 2>/dev/null); if [ -n "$out" ]; then echo "$out"; echo ""; fi; done | less'