Bartosz Bierkowski - Low dose cloud

OpenShift CLI morsels: showing labels of nodes in columns

With more than one node and more advanced setup than in minishift, you can use labels to add metadata to nodes. There are two ways to display later this information.

Showing all labels of a node

The following command returns all labels of all nodes. Normally the labels are not displayed and the --show-labels flag has to be used to show them.

Displaying only selected labels

As the number of labels and nodes grows, the output becomes unreadable. Usually just some of the metadata is useful at a time. The displayed labels can be then narrowed just to few that are helpful.

Lets show only architecture and os.

I like that the selected labels are shortened and presented in columns. This adds a lot to the readability and makes comparison between nodes a trivial task.

Environment

I executed the commands using minishift and the following client/server versions of OpenShift.

Client:
oc v1.5.0-alpha.2+e4b43ee
client kubernetes v1.5.2+43a9be4
Server:
openshift v1.3.1
server kubernetes v1.3.0+52492b4

Newsletter

Thanks for reading the OpenShift morsels. To get updates about new articles, you can sign up to the newsletter below.

As a thank you message, you will also get access to OpenShift CLI CheatSheet listing most commonly used commands together with a short explanation.

Did you like the article?
Join the newsletter to receive notifications about new articles.
I respect your privacy.