Skip to content

Instantly share code, notes, and snippets.

@dkeightley
Created March 9, 2021 20:41
Show Gist options
  • Save dkeightley/e2cd054afef748e83983ea051d424162 to your computer and use it in GitHub Desktop.
Save dkeightley/e2cd054afef748e83983ea051d424162 to your computer and use it in GitHub Desktop.
export ETCDCTL_API=3
for key in `etcdctl get --prefix --keys-only /registry/configmaps`
do
size=`etcdctl get $key --print-value-only | wc -c`
versions=`etcdctl get $key --write-out=fields | grep \"Version\" | cut -f2 -d':'`
total=$(( $size * $versions))
echo $total $size $versions $key >> /tmp/etcdkeys-configmaps.txt
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment