Skip to content

Instantly share code, notes, and snippets.

@flrichar
Created March 21, 2022 21:32
Show Gist options
  • Select an option

  • Save flrichar/c4dcb0d7a034dd03c9d9e2483fa5312c to your computer and use it in GitHub Desktop.

Select an option

Save flrichar/c4dcb0d7a034dd03c9d9e2483fa5312c to your computer and use it in GitHub Desktop.
count all objects in etcd from RKE
docker exec etcd etcdctl get /registry --prefix=true --keys-only | grep -v ^$ | awk -F'/' '{ if ($3 ~ /cattle.io/) {h[$3"/"$4]++} else { h[$3]++ }} END { for(k in h) print h[k], k }' | sort -n > etcd-count-objecttype.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment