Skip to content

Instantly share code, notes, and snippets.

@MadLittleMods
Created September 1, 2022 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MadLittleMods/99bac7a4611deeb41f81a41c56d4bb24 to your computer and use it in GitHub Desktop.
Save MadLittleMods/99bac7a4611deeb41f81a41c56d4bb24 to your computer and use it in GitHub Desktop.
View logs across projects in Red Hat OpenShift

With Red Hat OpenShift, here's how to view logs of a pod in a different project than the one currently active:

oc logs -n <project> <pod>

Option as documented but obscure and hard to follow because the option is namespace but oc always references them as projects everywhere else:

$ oc options
[...]
  -n, --namespace='': If present, the namespace scope for this CLI request

Searches that I made and failed to find this information.

  • oc logs pod not in project
  • oc logs pod across projects
  • oc logs pod multiple projects
  • openshift specify project
  • oc specify project in command
  • openshift specify multiple project
  • oc specify project in environment
  • openshift kubectl across projects
  • openshift activate multiple projects
  • openshift work on multiple projects
  • openshift oc logs across multiple project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment