Conversation
fourhu
force-pushed
the
feature/issue-853
branch
from
September 21, 2026 03:53
4a6be6d to
4872d31
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, unit tests for Kubernetes and Gateway API resources, and end-to-end coverage for Ingress and TCP CR. Refs haproxytech#853.
fourhu
force-pushed
the
feature/issue-853
branch
from
September 21, 2026 05:33
4872d31 to
0491475
Compare
Author
|
Superseded by a new PR with an accurate description of the current selector behavior. |
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, and whitelist/blacklist precedence.
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.