What is Annotations in Kubernetes?
There are two way using you can attach metadata to Kubernetes objects.
- labels
- annotations
Kubernetes annotations is used to attach arbitrary non-identifying metadata to objects. Clients such as tools and libraries can retrieve this metadata.
In contrast, annotations are not used to identify and select objects. The metadata in an annotation can be small or large, structured or unstructured, and can include characters not permitted by labels.
Annotations, like labels, are key/value maps:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
kompose.cmd: ./kompose convert
kompose.version: “”
FORMAT
"metadata": {
"annotations": {</p>
"key1" : "value1",</p>
"key2" : "value2"</p>
}
Here are some examples of information that could be recorded in annotations:
- Build, release, or image information like timestamps, release IDs, git branch, PR numbers, image hashes, and registry address.
- Pointers to logging, monitoring, analytics, or audit repositories.
More
https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
- Installing Jupyter: Get up and running on your computer - November 2, 2024
- An Introduction of SymOps by SymOps.com - October 30, 2024
- Introduction to System Operations (SymOps) - October 30, 2024