Skip to content

Instantly share code, notes, and snippets.

@dkeightley
Last active March 26, 2023 22:28
Show Gist options
  • Save dkeightley/6b01caef4d20d055c76f53d82d9515b2 to your computer and use it in GitHub Desktop.
Save dkeightley/6b01caef4d20d055c76f53d82d9515b2 to your computer and use it in GitHub Desktop.
rancher-pod-logs.sh
for pod in $(kubectl get pods -n cattle-system -l app=rancher --no-headers -o custom-columns=":metadata.name")
do
kubectl logs -n cattle-system $pod -c rancher --since=48h |& gzip > $pod.log.gz
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment