Skip to content

Instantly share code, notes, and snippets.

@dkeightley
Last active March 26, 2023 22:28
Show Gist options
  • Select an option

  • Save dkeightley/6b01caef4d20d055c76f53d82d9515b2 to your computer and use it in GitHub Desktop.

Select an option

Save dkeightley/6b01caef4d20d055c76f53d82d9515b2 to your computer and use it in GitHub Desktop.

Revisions

  1. dkeightley revised this gist Mar 26, 2023. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions rancher-pod-logs.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    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
    kubectl logs -n cattle-system $pod -c rancher --since=48h |& gzip > $pod.log.gz
    done
  2. dkeightley created this gist Mar 26, 2023.
    5 changes: 5 additions & 0 deletions rancher-pod-logs.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    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