CloudsArk
oc Commands Openshift

oc Adm Must Gather Explained

Learn practical oc adm must gather explained with oc commands, OpenShift manifests, verification steps, common mistakes, and production-focused guidance.

oc Adm Must Gather Explained

Introduction

oc adm must-gather collects cluster diagnostics for support or deep troubleshooting. Run it from a workstation with enough disk space and avoid sharing archives without checking for sensitive data.

When You Need This Command

Use this command when you need to inspect, change, or verify OpenShift resources from the terminal without relying on the web console.

Syntax

oc <command> <resource> [name] -n <project>

Practical Examples

oc adm must-gather
ls -lh must-gather.local.*
tar -czf must-gather.tar.gz must-gather.local.*
du -sh must-gather.local.*

Example output:

INFO Gathering data for ns/openshift-cluster-version...
INFO Wrote gather data to must-gather.local.1234567890

Verification

ls -lh must-gather.local.*
find must-gather.local.* -maxdepth 2 -type d | head

Common Mistakes

  • Running must-gather from a nearly full filesystem.
  • Uploading diagnostics without reviewing sensitive project data.
  • Collecting too late after logs have rotated.

Production Notes

Run read-only commands first, check the active project, and prefer declarative manifests for repeatable changes.

Quick Checklist

  • Confirm the active project.
  • Inspect the exact object named in the error.
  • Read recent events.
  • Apply one focused fix.
  • Verify status after the change.

Summary

oc Adm Must Gather Explained is most useful when paired with verification. Check the project, run the command against the intended object, and confirm the resulting OpenShift state.