Last active
July 10, 2018 15:27
-
-
Save tonytan4ever/922a11add9ec6b4519654d13abd3c475 to your computer and use it in GitHub Desktop.
Get logs from multiple pods
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
#!/usr/bin/env bash | |
NAMEPSACE=$1 | |
DEPLOYMENT=$2 | |
for p in $(kubectl get pods --namespace ${NAMEPSACE} | grep ^${DEPLOYMENT}- | cut -f 1 -d ' '); do | |
echo --------------------------- | |
echo $p | |
echo --------------------------- | |
kubectl logs $p --name ${NAMEPSACE} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment