Added kube-count-events

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
Marcus Noble 2022-04-29 16:22:55 +02:00
parent b25a5c4c8d
commit 6680689910
Signed by: AverageMarcus
GPG Key ID: B8F2DB8A7AEBAF78

29
home/.bin/kube-count-events Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env bash
source .utils
set -e
print_usage() {
blue "kube-count-events - Counts events by type"
echo " "
underline "Usage:"
echo "kube-count-events [options]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
}
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
kubectl get events -A | awk '{ print $4 }' | sort | uniq -c | sort -bgr