
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>
}Code language: PHP (php)
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/
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals