cfg/.zsh/config.sh.d/kubernetes.sh
Knut Ahlers 4e91ed6c22
Improve k8s ressource listing / dumping
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2023-06-13 16:26:00 +02:00

19 lines
368 B
Bash

function kubectlgetall {
local namespace="${1}"
shift
for res in $(
kubectl api-resources --verbs=list --namespaced -o name |
grep -v "events.events.k8s.io" |
grep -v "events" |
sort | uniq
); do
echo "Resource: ${res}" >&2
kubectl \
-n ${namespace} \
get --ignore-not-found \
"${res}" \
"${@}"
done
}