- Ensure you're logged in with
oc
- Change
REPLACEME
to your project name:
PROJECT=REPLACEME; echo "Processing project ${PROJECT}"; for pod in $(oc get pods -n $PROJECT -o jsonpath='{.items[*].metadata.name}'); do echo "Processing pod ${pod}"; for container in $(oc get pod $pod -n $PROJECT -o jsonpath="{.spec.containers[*].name}"); do oc logs $pod -c $container -n $PROJECT &> diag_podlogs_${PROJECT}_${pod}_${container}_$(date +%Y%m%d_%H%M%S).txt; oc logs --previous $pod -c $container -n $PROJECT &> diag_lastpodlogs_${PROJECT}_${pod}_${container}_$(date +%Y%m%d_%H%M%S).txt; done; done
- Upload
diag*.txt
- Web console } Administrator } Workloads } Pods }
$PODNAME
} Logs } Download
Previous Section (OpenShift Investigate ImagePullBackOff Recipe) |
Next Section (OpenShift Download Container Files Recipe) |
Back to Table of Contents