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.
NAME STATUS AGE
192.168.42.6 Ready 6d
NAME STATUS AGE LABELS
192.168.42.6 Ready 6d beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=192.168.42.6
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.
NAME STATUS AGE ARCH OS
192.168.42.6 Ready 6d amd64 linux
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.
I executed the commands using minishift and the following client/server versions of OpenShift.
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.