Conversation
fourhu
force-pushed
the
feature/issue-853
branch
2 times, most recently
from
September 21, 2026 01:59
fc421ae to
37fb20a
Compare
Introduce --namespace-label-selector with dynamic per-namespace watch sessions. Namespace label changes update the watched resource set without restarting the controller, while whitelist and blacklist configurations retain precedence. Add stale-session protection, lifecycle handling, documentation, and unit and end-to-end coverage for Kubernetes and Gateway API resources. Refs haproxytech#853.
fourhu
force-pushed
the
feature/issue-853
branch
from
September 21, 2026 02:03
37fb20a to
e1d6416
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #853.
Summary
Add
--namespace-label-selectorfor clusters where namespace membership is controlled by labels instead of a fixed name list.Matching namespaces are watched at startup. Labeling a namespace starts its watches without restarting the controller; removing or changing the label removes its resources from HAProxy configuration. Relabeling starts a fresh list/watch so changes made while the namespace was unselected are loaded.
--namespace-whitelistand--namespace-blacklistkeep precedence. If either is configured, the selector is ignored with a warning. With the selector unset, the existing informer path is unchanged.Implementation
Validation
The branch adds unit and sequential Kubernetes e2e coverage for startup selection, label and unlabel transitions, relabeling, stale sessions, namespace deletion and recreation, TCP CRs, late CRDs, whitelist and blacklist precedence, and Gateway
AllowedRoutesbehavior.The same source tree passed GitHub Actions on Kubernetes v1.34.0, including the standard e2e job, the Gateway e2e job, build, linters, generated-file checks, formatting, and module checks:
https://github.com/fourhu/kubernetes-ingress/actions/runs/35522646678
Trade-off
The selector path creates informer factories per selected namespace. API traffic and goroutine count therefore grow with the number of matches. This option is intended for a bounded namespace set; leaving the flag unset keeps the current shared-informer behavior.