Last active
January 15, 2024 07:51
-
-
Save fmuyassarov/bf70dead1f2126b8ee8d88dd29c997c5 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
ns=${NS:-default} | |
BLUE='\033[0;34m' | |
Color_Off='\033[0m' | |
for pod in $(kubectl -n $ns get pods | tr -s '\t' ' ' | | |
cut -d ' ' -f1 | grep -v ^NAME | tr -d '"'); do | |
for ctr in $(kubectl get -n $ns pod $pod -o json | | |
jq '.spec.containers[].name' | tr -d '"'); do | |
echo -e "* resources for ${BLUE}$pod:$ctr" | |
echo -e "${Color_Off}$(kubectl exec -n $ns -c $ctr $pod -- cat /proc/self/status | | |
grep _allowed_list | sed 's/^/ /g')" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment