Last active
March 16, 2023 01:29
rancher-pod-logs
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
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 |& gzip > $pod.log.gz | |
kubectl logs -n cattle-system $pod -c rancher -p |& gzip > $pod.previous.log.gz | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment