OpenShift - Label a Persistent Volume using the oc label command

by
Jeremy Canfield |
Updated: February 20 2025
| OpenShift articles
Let's say you have a Persistent Volume named my-persistent-volume. The oc describe persistentvolume command can be used to list the labels currently associated with the Persistent Volume.
~]$ oc describe persistentvolume my-persistent-volume
Name: my-persistent-volume
Labels: <none>
The oc label persistentvolume command can be used to apply one or more labels to the Persistent Volume.
oc label persistentvolume my-persistent-volume region=east
You can then use the oc describe persistentvolume command again to see that the Persistent Volume has the label.
~]$ oc describe persistentvolume my-persistent-volume
Name: my-persistent-volume
Labels: region=east
And here is how you would remove a label from a Persistent Volume.
oc label persistentvolume my-persistent-volume region-
Did you find this article helpful?
If so, consider buying me a coffee over at