Jordan Moore 9dc73c0267
garbage collection for unneeded pdb/hpa/vpa (#1183)
When a Gateway or GatewayParameters is updated or deleted such that a
previously-created PodDisruptionBudget, HorizontalPodAutoscaler, or
VerticalPodAutoscaler is no longer required, the controller does not
currently remove those resources. This is a resource leak.

ownerReferences-based garbage collection is insufficient here because it
only fires when the owner is deleted — if the owner (e.g. the Gateway)
still exists but has been updated to no longer require a PDB/HPA/VPA,
Kubernetes will not clean up the now-orphaned resource.

The `PruneRemovedResources` method on the `Deployer` collects
pdb/hpa/vpa resources owned by the reconciling gateway and checks them
against the list of desired objects and prunes those which are
undesired.
2026-03-12 20:48:48 +00:00
..