Skip to content

Instantly share code, notes, and snippets.

@Martlark
Last active October 29, 2023 14:54
Show Gist options
  • Save Martlark/d9093394cc430195fc04b5fe7973e8c2 to your computer and use it in GitHub Desktop.
Save Martlark/d9093394cc430195fc04b5fe7973e8c2 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