Add kube-list-rss-names script
to get all available rss in namespace Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
903cfb99fd
commit
fd63efc409
1 changed files with 23 additions and 0 deletions
23
bin/kube-list-rss-names
Executable file
23
bin/kube-list-rss-names
Executable file
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
source ~/bin/script_framework.sh
|
||||||
|
|
||||||
|
namespace="${1:-}"
|
||||||
|
[[ -n $namespace ]] || fatal "Missing namespace."
|
||||||
|
|
||||||
|
step "Collecting available api-resources..."
|
||||||
|
api_rss=($(
|
||||||
|
kubectl api-resources --verbs=list --namespaced -o name |
|
||||||
|
grep -v "events.events.k8s.io" |
|
||||||
|
grep -v "events" |
|
||||||
|
sort | uniq
|
||||||
|
))
|
||||||
|
|
||||||
|
for rss in "${api_rss[@]}"; do
|
||||||
|
step "Listing names in api-resource ${rss}..."
|
||||||
|
|
||||||
|
kubectl -n "${namespace}" \
|
||||||
|
get --ignore-not-found "${rss}" \
|
||||||
|
-o name
|
||||||
|
done
|
Loading…
Reference in a new issue