aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2026-01-05 10:00:23 +0100
committerPatrick Spek <p.spek@tyil.nl>2026-01-05 10:00:23 +0100
commitaf95bc283d2f71140e40a7bbe2c177dd78791bfc (patch)
treefc03f4d2fada6446c27abe3d485ec63b56b62204
parent166ab0a62a29174df21156751923685eeaa77a45 (diff)
downloaddotfiles-af95bc283d2f71140e40a7bbe2c177dd78791bfc.tar.gz
dotfiles-af95bc283d2f71140e40a7bbe2c177dd78791bfc.tar.bz2
Add kubectl subcommand for listing all used registries
-rwxr-xr-x.local/bin/kubectl-registries13
1 files changed, 13 insertions, 0 deletions
diff --git a/.local/bin/kubectl-registries b/.local/bin/kubectl-registries
new file mode 100755
index 0000000..c0a6d54
--- /dev/null
+++ b/.local/bin/kubectl-registries
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+main() {
+ kubectl get pods \
+ --all-namespaces \
+ -o jsonpath="{.items[*].spec['initContainers', 'containers'][*].image}" \
+ | tr -s '[[:space:]]' '\n' \
+ | sort \
+ | uniq -c \
+ | cut -d "/" -f 1
+}
+
+main "$@"