Adding An Annotation
For adding an annotation, we simply use the “annotate” command as we used earlier, Enter the following command in your terminal:
kubectl annotate service example description='this is the example description'
and you can check the information about the service by “kubectl describe” command like before:
kubectl describe service example
This will give an output wiith an additional annotation in our example service:
How to Use Kubernetes Annotations?
Annotations are key-value pairs that are used to attach non-identifying metadata to Kubernetes objects. Various tools that are built over Kubernetes use this metadata attached by annotations to perform actions or enhance resource management. Labels and Annotations are used to attach metadata to Kubernetes objects. This makes annotations important for working with Kubernetes clusters. To learn more about Kubernetes cluster and its architecture refer to Kubernetes – Architecture.