Created
March 13, 2022 19:29
-
-
Save flrichar/73fd58bddb83bc89957e8dbcfec0f456 to your computer and use it in GitHub Desktop.
all etcd object sizes
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
| ## Exec into the etcd container | |
| docker exec -it etcd sh | |
| ## All objects | |
| for key in `etcdctl get --prefix --keys-only /` | |
| 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.txt | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment