Interview Prep/Helm/Helm 3 Architecture & Release Storage

How does Helm know which resources belong to a release?

IntermediateConceptHelm 3 Architecture & Release Storage
Answer

From the manifest stored in the release record, not from labels. Helm also stamps every resource it manages with ownership metadata, which it checks before touching an existing object:

metadata:
  labels:
    app.kubernetes.io/managed-by: Helm
  annotations:
    meta.helm.sh/release-name: shop
    meta.helm.sh/release-namespace: shop

If an object with the same kind/name exists without matching metadata, install or upgrade fails with rendered manifests contain a resource that already exists ... invalid ownership metadata.

All Helm questions Roadmap: Helm

More on Helm 3 Architecture & Release Storage