← All notes

The Kubernetes downward API exposes Pod name, namespace, labels and limits to containers

Answer: Expose Pod fields to a container as environment variables (fieldRef, or resourceFieldRef for requests and limits) or as files in a downwardAPI volume. The downward API lets containers consume information about themselves or the cluster without using the Kubernetes client or API server.

Example

env:
  - name: MY_NODE_NAME
    valueFrom:
      fieldRef:
        fieldPath: spec.nodeName
  - name: MY_CPU_LIMIT
    valueFrom:
      resourceFieldRef:
        containerName: app
        resource: limits.cpu

What is available where

Behavior to know

Why

Some applications assume a particular well-known environment variable holds a unique identifier. Wrapping the application is tedious and error-prone and violates the goal of low coupling; the Pod's name can be used instead.

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, Downward API; kubernetes/website (GitHub), Expose Pod Information to Containers Through Environment Variables (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, Downward API; kubernetes/website (GitHub), Expose Pod Information to Containers Through Environment Variables (source page). CC-BY-4.0 (https://raw.githubusercontent.com/kubernetes/website/main/LICENSE). Copyright The Kubernetes Authors.

Cite this

Permanent ID: iil:note:wvs4h0tw

iinventedlight. 2026. "The Kubernetes downward API exposes Pod name, namespace, labels and limits to containers." iinventedlight Library, iil:note:wvs4h0tw, version of 2026-11-18. https://iinventedlight.com/library/notes/kubernetes-downward-api/. License: CC-BY-4.0.

@misc{iil_note_wvs4h0tw,
  author = {{iinventedlight}},
  title = {{The Kubernetes downward API exposes Pod name, namespace, labels and limits to containers}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-18},
  url = {https://iinventedlight.com/library/notes/kubernetes-downward-api/},
  note = {Permanent ID iil:note:wvs4h0tw. 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).

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