Skip to content

Instantly share code, notes, and snippets.

@tonytan4ever
Last active July 10, 2018 15:27
Show Gist options
  • Save tonytan4ever/922a11add9ec6b4519654d13abd3c475 to your computer and use it in GitHub Desktop.
Save tonytan4ever/922a11add9ec6b4519654d13abd3c475 to your computer and use it in GitHub Desktop.
Get logs from multiple pods
#!/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