annotation
What is annotation?
annotation: A key/value note attached to an object for tools and humans — not used for selection. Holds metadata like ingress config or change cause. An annotation in Kubernetes is a key and value attached to an object, such as a Deployment or Ingress. It stores extra information for tools and people. Unlike labels, annotations are not used to select objects.
Frequently asked questions about annotation
How is annotation used in practice?
Many tools are configured through annotations. An ingress controller reads nginx.ingress.kubernetes.io/proxy-body-size to allow larger uploads, and cert-manager reads annotations to know which certificate to issue. Annotations can also record who deployed something or which commit is running.
What should you keep in mind with annotation?
Use labels for things you filter or group by, such as app or environment. Use annotations for everything else. Values can be long and structured, but keep them meaningful. A typo in an annotation key fails silently, because Kubernetes accepts any key, so check the exact spelling in the tool's documentation when a setting seems ignored.
What does an example of annotation look like?
metadata: annotations: nginx.ingress.kubernetes.io/rewrite-target: / kubernetes.io/change-cause: "bump to v1.27" At a glance
| Category | Kubernetes |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |