Skip to content

Instantly share code, notes, and snippets.

@foo0x29a
Created June 14, 2018 14:49
Show Gist options
  • Save foo0x29a/f78d7d68042edba6bfb661fa707eca2a to your computer and use it in GitHub Desktop.
Save foo0x29a/f78d7d68042edba6bfb661fa707eca2a to your computer and use it in GitHub Desktop.
Print pods memory usage of a given namespace
( NAMESPACE="staging"; for i in $(kubectl top pods -n $NAMESPACE | awk 'NR>1{split($3,a,"Mi"); print a[1];}'); do total=$(( $total + $i )); done; echo $total; )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment