Kubernetes finalizers - why objects stay in Terminating and how deletion completes
Answer: Finalizers are keys in metadata.finalizers that make the API server hold an object until controllers finish cleanup. They alert controllers to run specific cleanup tasks first, which gives you control over garbage collection.
Example
apiVersion: v1
kind: ConfigMap
metadata:
name: demo
finalizers:
- example.com/cleanup-bucket
kubectl get pv my-volume -o jsonpath='{.metadata.finalizers}'
kubectl get pv my-volume -o jsonpath='{.metadata.deletionTimestamp}'
What happens on delete
- The API server adds a
metadata.deletionTimestampwith the time you started the deletion. - It prevents the object from being removed until all items are removed from
metadata.finalizers, and returns202(Accepted). - The controller for that finalizer notices the deletion request, satisfies its requirements, and removes its key from
finalizers. - When the
finalizersfield is emptied, the object is automatically deleted.
Rules
- Once deletion starts you can remove existing finalizers but you cannot add a new finalizer, and you cannot modify the
deletionTimestamp. - After the deletion is requested, you can not resurrect this object; delete it and make a new similar object.
- Custom finalizer names must be publicly qualified, such as
example.com/finalizer-name; the API server rejects writes that use unqualified names. - Finalizers don't usually specify the code to execute; they are lists of keys, similar to annotations.
Common example
kubernetes.io/pv-protection prevents accidental deletion of a PersistentVolume in use by a Pod. Deleting it leaves it in Terminating until the Pod stops using it, then Kubernetes clears the finalizer and the volume is deleted.
Stuck objects
Finalizers can block the deletion of dependent objects, so an owner may remain longer than expected. Check finalizers and owner references on both objects. Avoid manually removing finalizers; only do it when the finalizer's purpose is understood and accomplished in another way.
See also
Claims
- id: C1 claim: The API server returns 202 Accepted for a delete with finalizers. source: S2 evidence: "Returns a
202status code (HTTP \"Accepted\")"
- id: C2 claim: Custom finalizer names must be publicly qualified. source: S2 evidence: "Custom finalizer names must be publicly qualified finalizer names"
- id: C3 claim: Deleted objects can not be resurrected. source: S1 evidence: "After the deletion is requested, you can not resurrect this object."
Sources
- [S1] Finalizers. Kubernetes docs. https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers/ . License: CC-BY-4.0. Accessed 2026-11-18.
- [S2] finalizers.md (source page). kubernetes/website (GitHub). https://github.com/kubernetes/website/blob/main/content/en/docs/concepts/overview/working-with-objects/finalizers.md . License: CC-BY-4.0. Accessed 2026-11-18.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Kubernetes docs, Finalizers; kubernetes/website (GitHub), finalizers.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, Finalizers; kubernetes/website (GitHub), finalizers.md (source page). CC-BY-4.0 (https://raw.githubusercontent.com/kubernetes/website/main/LICENSE). Copyright The Kubernetes Authors.
Cite this
iinventedlight. 2026. "Kubernetes finalizers - why objects stay in Terminating and how deletion completes." iinventedlight Library, iil:note:7531qvb3, version of 2026-11-18. https://iinventedlight.com/library/notes/kubernetes-finalizers/. License: CC-BY-4.0.
@misc{iil_note_7531qvb3,
author = {{iinventedlight}},
title = {{Kubernetes finalizers - why objects stay in Terminating and how deletion completes}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-18},
url = {https://iinventedlight.com/library/notes/kubernetes-finalizers/},
note = {Permanent ID iil:note:7531qvb3. License: CC-BY-4.0.},
}
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-finalizers.md.