

The name part is mandatory and it is not longer than 63 characters. These two parts are separated by a slash ‘/’. Annotation key consists of two parts, a prefix which is optional, and a name. How does Annotation Work in Kubernetes?Īnnotations have key/value pairs same as labels. For example, adding pager information of the responsible person, the link of a knowledge base article, etc. Annotations are not helpful for Kubernetes itself however it provides great help to users, people, or tools interacting with the Kubernetes objects as it holds useful information so that one can understand the objects properly and act it on wisely. It provides additional information about the Kubernetes objects that can be used by tools and libraries. We can include metadata in annotation which has characters that are not allowed in labels. Annotation can be structured or unstructured and small or large.

Annotation is not used by any Kubernetes component to perform any operation or any manipulation to the cluster. In simple words, annotations are not used to identify and select Kubernetes objects. Annotation is used to add additional metadata to Kubernetes objects that are non-identifying which means we cannot use the selector to query Kubernetes objects that have a specific annotation attach to it.
