Created
February 10, 2020 20:19
-
-
Save mattmattox/bb04e47cff9520bf60bfef575044563b to your computer and use it in GitHub Desktop.
Oneliners to grab logs from Rancher pods
This file contains 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/bash | |
KUBECONFIG=~/.kube/config | |
for POD in $(kubectl --kubeconfig $KUBECONFIG get pods -n cattle-system -l app=rancher --no-headers | awk '{print $1}'); | |
do | |
kubectl --kubeconfig $KUBECONFIG -n cattle-system logs $POD > ./logs-"$POD" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment