Last active
June 17, 2019 13:32
-
-
Save hexfusion/e5e9d44db9721f0f52d0804b0406f46e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env bash | |
set -euo pipefail | |
export ETCDCTL_API=3 | |
# populate | |
ENDPOINTS="" | |
for base in kubernetes openshift; do | |
readarray RESOURCES <<< \ | |
"$(etcdctl --cacert=/etc/etcd/ca.crt --cert=/etc/etcd/peer.crt --key=/etc/etcd/peer.key \ | |
--endpoints=$ENDPOINTS --command-timeout=30s \ | |
get --prefix / --keys-only 2>/dev/null | grep -oP "(?<=/${base}.io\/).+?(?=\/)" | sort | uniq)" | |
for res in "${RESOURCES[@]}"; do | |
BYTES=$(etcdctl --cacert=/etc/etcd/ca.crt --cert=/etc/etcd/peer.crt --key=/etc/etcd/peer.key \ | |
--endpoints=$ENDPOINTS --command-timeout=30s \ | |
get --prefix /${base}.io/$res -w protobuf | wc -c) | |
echo "/${base}.io/$res - Total Bytes: $BYTES" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment