Skip to content

Instantly share code, notes, and snippets.

@tsrimahesh
Forked from Martlark/log_deployment.sh
Created September 13, 2022 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsrimahesh/11212b8060f191c7d4ea768f04856967 to your computer and use it in GitHub Desktop.
Save tsrimahesh/11212b8060f191c7d4ea768f04856967 to your computer and use it in GitHub Desktop.
Simple script to get logs from the pods of a deployment
#!/usr/bin/env bash
DEPLOYMENT=$1
for p in $(kubectl get pods | grep ^${DEPLOYMENT}- | cut -f 1 -d ' '); do
echo ---------------------------
echo $p
echo ---------------------------
kubectl logs $p
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment