Skip to content

Instantly share code, notes, and snippets.

@WadeBarnes
Last active December 3, 2024 13:24
Show Gist options
  • Save WadeBarnes/00bccebfe9c258706a1a4951af825606 to your computer and use it in GitHub Desktop.
Save WadeBarnes/00bccebfe9c258706a1a4951af825606 to your computer and use it in GitHub Desktop.
List apps in OpenShift

Scripts to provide a deduplicated list of all apps in a namespace or namespace.

List apps in all namespaces:

oc projects -q | xargs -I {} oc -n {} label all --all --list 2>/dev/null | grep app= | awk '!a[$0]++' | sed s~app=~~

List apps in a given namespace:

oc -n a99fd4-dev label all --all --list 2>/dev/null | grep app= | awk '!a[$0]++' | sed s~app=~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment