ownerReferences, Kubernetes will automatically garbage-collect those child objects when the WebApp is deleted.


deletionTimestamp on the object and keeps it visible so the controller can detect the deletion and run cleanup logic. Only after the controller removes the finalizer will the API server finish the deletion.

- Normal reconcile
- Ensure the finalizer is present on the resource.
- Create or update child Kubernetes resources (Deployments, Services, ConfigMaps).
- Deleting reconcile
- Detect
deletionTimestampand skip normal creation/reconciliation. - Perform cleanup of external resources (DNS records, cloud objects, etc.).
- Remove the finalizer to allow the API server to complete deletion.
- Detect


Design cleanup operations so they are idempotent and fast. For example, check for the existence of an external resource and treat “not found” as success rather than an error. This prevents controllers from getting stuck on permanent failures.
Terminating state indefinitely. That situation is confusing in development environments and dangerous in production because users may assume deletion completed when it has not.

Always ensure your cleanup path can complete (or safely determine that there is nothing left to clean) and that the finalizer is removed. Otherwise resources will remain stuck in a Terminating state.

- Reconcile paths at a glance:
- WebApp operator lifecycle stages:
Links and references
- Kubernetes finalizers documentation
- Kubernetes ownerReferences documentation
- Patterns for operators and controllers: consider controller-runtime and Operator SDK documentation for implementing reconciles and finalizers