← All notes

Kubernetes annotations - non-identifying metadata for tools, with key rules and the 256 KiB limit

Answer: Annotations, like labels, are key/value maps under metadata.annotations. Annotations attach arbitrary non-identifying metadata to objects for tools and libraries to read; unlike labels, they are not used to identify and select objects.

Example

apiVersion: v1
kind: Pod
metadata:
  name: annotations-demo
  annotations:
    imageregistry: "https://hub.docker.com/"
    example.com/git-commit: "a1b2c3d"
spec:
  containers:
  - name: nginx
    image: nginx:1.14.2
kubectl annotate pod annotations-demo example.com/owner=team-a
kubectl annotate pod annotations-demo example.com/owner-

Labels versus annotations

| | Labels | Annotations | |---|---|---| | Select objects | can be used to select objects | not used to select objects | | Value characters | restricted | any string, including JSON or YAML | | Size | small | small or large, structured or unstructured |

An object can use labels as well as annotations at the same time.

Key and value rules

Typical uses

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Kubernetes docs, Annotations; kubernetes/website (GitHub), annotations.md (source page). CC-BY-4.0 (https://raw.githubusercontent.com/kubernetes/website/main/LICENSE). Copyright The Kubernetes Authors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Kubernetes docs, Annotations; kubernetes/website (GitHub), annotations.md (source page). CC-BY-4.0 (https://raw.githubusercontent.com/kubernetes/website/main/LICENSE). Copyright The Kubernetes Authors.

Cite this

Permanent ID: iil:note:1er95709

iinventedlight. 2026. "Kubernetes annotations - non-identifying metadata for tools, with key rules and the 256 KiB limit." iinventedlight Library, iil:note:1er95709, version of 2026-11-18. https://iinventedlight.com/library/notes/kubernetes-annotations/. License: CC-BY-4.0.

@misc{iil_note_1er95709,
  author = {{iinventedlight}},
  title = {{Kubernetes annotations - non-identifying metadata for tools, with key rules and the 256 KiB limit}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-18},
  url = {https://iinventedlight.com/library/notes/kubernetes-annotations/},
  note = {Permanent ID iil:note:1er95709. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/kubernetes-annotations.md.