Bartosz Bierkowski - Low dose cloud

OpenShift Morsels: labels vs annotations

Day #3 – When describing pods and other resources, you can see two sets of key value pairs. One is called Labels and the other Annotations.

Below you can see just a part of oc describe output that lists both labels and annotations.

I get to use labels quite often and I hardly ever use annotations. I asked myself what are they and what is their purpose? From the example above it seems that labels are more concise than annotations. It is because they serve different purposes.

Labels should be used by end users. If something is meant to be used by a person, put it into a label.

Annotations on the other hand are dedicated to be used for technical purposes. You can see in the example above that the Annotation contains some JSON. Otherr values are similar to what you can find in the Labels.


The official documentation for OpenShift and Kubernetes serve quite a few examples for both. Just search for annotation or label on the pages below to get a better feeling on how they are used.

Annotations – Kubernetes documentation about annotations

Labels – Kubernetes documentation about labels


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

oc v3.6.1+008f2d5
client kubernetes v1.6.1+5115d708d7
openshift v3.6.0+c4dd4cf
server kubernetes v1.6.1+5115d708d7


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.