This commit is contained in:
mr0xb 2026-05-28 10:06:45 -04:00
commit 792e5dc2ed
No known key found for this signature in database
2 changed files with 26 additions and 0 deletions

18
.zshrc.d/kimgs.zsh Normal file
View file

@ -0,0 +1,18 @@
kimgs() {
local context="${1:-$(kubectl config current-context 2>/dev/null)}"
if [[ -z "$context" ]]; then
echo "kimgs: no context specified and no current context set" >&2
return 1
fi
kubectl --context="$context" get pods --all-namespaces \
-o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{range .spec.containers[*]}{.name}{"\t"}{.image}{"\n"}{end}{end}' \
| column -t -s $'\t'
}
kutil () {
for host in $(kubectl get nodes --no-headers | cut -d' ' -f1)
do
echo "$host - $(kubectl get nodes -o jsonpath='{.metadata.labels.topology\.kubernetes\.io/zone}' $host)"
kubectl describe node "$host" | grep --color Allocated -A 5 | grep --color -ve Event -ve Allocated -ve percent -ve --
echo
done
}

8
.zshrc.d/kutil.zsh Normal file
View file

@ -0,0 +1,8 @@
kutil () {
for host in $(kubectl get nodes --no-headers | cut -d' ' -f1)
do
echo "$host - $(kubectl get nodes -o jsonpath='{.metadata.labels.topology\.kubernetes\.io/zone}' $host)"
kubectl describe node "$host" | grep --color Allocated -A 5 | grep --color -ve Event -ve Allocated -ve percent -ve --
echo
done
}