Support for health check policies was added in #11629 which placed the HealthCheck definition on the HTTPListenerPolicy API. The impl introduced the ApplyListenerPlugin and HttpFilters lifecycle methods to the plugin.
The original intent of this API was to be a place to hold the various HCM knobs present when using Envoy as a dataplane. The naming is very confusing due to overloading of "listener" in Envoy and Gateway API terminology.
The HTTPListenerPolicy API intentionally doesn't support section names as it was only intended to be attached to a Gateway resource as a whole. So by design, anything on the policy will be applied to all Gateway API Listeners associated with a given Gateway.
See #11505 and https://github.com/kgateway-dev/kgateway/blob/main/design/11387.md for an example where we intentionally didn't use HTTPListenerPolicy to handle something that is associated with an envoy listener.
We should reevaluate if HTTPListenerPolicy is the correct location for defining health checks.
Support for health check policies was added in #11629 which placed the HealthCheck definition on the
HTTPListenerPolicyAPI. The impl introduced theApplyListenerPluginandHttpFilterslifecycle methods to the plugin.The original intent of this API was to be a place to hold the various HCM knobs present when using Envoy as a dataplane. The naming is very confusing due to overloading of "listener" in Envoy and Gateway API terminology.
The
HTTPListenerPolicyAPI intentionally doesn't support section names as it was only intended to be attached to a Gateway resource as a whole. So by design, anything on the policy will be applied to all Gateway APIListenersassociated with a givenGateway.See #11505 and https://github.com/kgateway-dev/kgateway/blob/main/design/11387.md for an example where we intentionally didn't use HTTPListenerPolicy to handle something that is associated with an envoy listener.
We should reevaluate if HTTPListenerPolicy is the correct location for defining health checks.