Created
December 4, 2018 01:11
-
-
Save Oats87/cab6b44f75d1d5dd2250e96490da142b to your computer and use it in GitHub Desktop.
This grabs the rancher server logs from the pods running and tars them
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
#!/bin/sh | |
now=`date +%Y-%m-%d-%H-%M-%S` | |
for i in $(kubectl get po -n cattle-system | grep "rancher" | awk '{print $1}'); do | |
echo "Collecting Rancher Logs from: $i" | |
kubectl logs $i -n cattle-system > cs-$i-$now.log; | |
done | |
tar -zcvf rancher-logs-$now.tar.gz cs-*.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment