sakshi-80
Mission Specialist
Mission Specialist
  • 532 Views

Openshift command to find label keys

Hi Team,

 

Is there an Openshift command that lists all the label keys like  `node-role.kubernetes.io` , `machineconfiguration.openshift.io/role' ?

 

 

Thanks

Sakshi

3 Replies
Wasim_Raja
Moderator
Moderator
  • 480 Views

@sakshi-80 Thank you for reaching out.

Can you give it a try for "$ oc api-resources --verbs=list --selector=node-role.kubernetes.io"

0 Kudos
sakshi-80
Mission Specialist
Mission Specialist
  • 448 Views

Thanks @Wasim ffor the reply. I need to rephrase my question correctly.

Is there any oc command or documentation that lists all the supported open shift label key?

 

 

0 Kudos
IvanLabrovic
Flight Engineer
Flight Engineer
  • 281 Views

I don't know if such thing exists because you can basically use any label you want.
Example: oc label cm cm1 'anything.io/You.want'=possible
configmap/cm1 labeled

If it helps more, you can have the oc command show all labels for about any resource.
e.g.: oc get cm --show-labels
NAME DATA AGE LABELS
cm1 1 4m49s anything.io/You.want=possible

0 Kudos
Join the discussion
You must log in to join this conversation.