Search code examples
openshiftpersistent-storageopenshift-client-tools

List all PVCs of an Openshift cluster


How to list from the commandline, all PVCs of an Openshift cluster ?

From my understanding, the scope of PVCs is the namespace/project, in which it was created. Listing the PVCs implies being connected (using) or at least mentioning the namespace. The best I came up with is :

$ for i in $(oc get project -o name|cut -d"/" -f 2);do echo "Project: $i";oc get pvc -n $i;done

Is there a better/cleaner/quickier way ?


Solution

  • As an admin, try running:

    oc get pvc --all-namespaces