Finalizers: When and Why

Finalizers prevent resource deletion until cleanup runs.

When

The finalizer pattern is Kubernetes' mechanism for ensuring cleanup before resource deletion. Resources with external dependencies use finalizers to perform their cleanup; deletion is blocked until cleanup completes.

What when-to-use looks like:

The when-to-use is clear. External state needs cleanup; finalizers are the mechanism.

How

The mechanism is straightforward. Add finalizer to the resource; the controller observes; the controller cleans up; the controller removes the finalizer; Kubernetes proceeds with deletion.

The mechanism is well-defined. Once understood, it is straightforward to implement.

Avoid

The most common problem with finalizers is when they get stuck. The controller is not running; the cleanup cannot complete; the resource cannot be deleted; the team must intervene.

Finalizer pattern is one of those Kubernetes platform engineering disciplines that pays off when external state matters. Nova AI Ops integrates with custom resources, surfaces patterns, and supports the team's CRD-driven discipline.