You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add serviceLabelSelector for label-based Service filtering (#307)
* feat: add serviceLabelSelector for label-based Service filtering
Add a new `serviceLabelSelector` configuration directive that filters
which Service resources are watched by a k8s_gateway instance, using
standard Kubernetes label selector syntax. Filtering is applied at the
API level via ListOptions.LabelSelector so non-matching Services are
never fetched or cached.
This enables split-horizon DNS setups where multiple k8s_gateway
instances serve different network views without Services leaking
across DNS views.
Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
* feat: support multiple serviceLabelSelectors for OR-of-ANDs filtering
Each selector creates a separate Service informer; lookupServiceIndex
queries all informers and deduplicates results by namespace/name.
Selectors are normalized at parse time via labels.Parse().String().
Rename directive and Helm value from serviceLabelSelector (singular)
to serviceLabelSelectors (plural) to reflect the new list semantics.
Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
* feat(helm): add serviceLabelSelectors docs and configmap tests
Add helm-unittest cases for single selector, multiple selectors,
and empty (omitted) rendering. Update chart README parameter table.
Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
* refactor(tests): use service-oriented naming in test fixtures
Replace kitchen/bedroom/garage test names with service1/service2/service3
to better reflect the domain being tested.
* refactor(tests): simplify label selectors to use app= pattern
Use consistent app=serviceN labels across both TestServiceLabelSelector
and TestMultiSelectorServiceLookup for clarity.
* refactor(tests): normalize remaining label selectors to app= pattern
* fix: reject empty strings in serviceLabelSelectors parsing
* test: verify error messages in TestServiceLabelSelectorParsing
Add expectedErr substring assertions for all error test cases.
---------
Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,7 @@ k8s_gateway [ZONES...]
58
58
resources [RESOURCES...]
59
59
ingressClasses [CLASSES...]
60
60
gatewayClasses [CLASSES...]
61
+
serviceLabelSelectors SELECTOR [SELECTOR...]
61
62
ttl TTL
62
63
apex APEX
63
64
secondary SECONDARY
@@ -69,6 +70,7 @@ k8s_gateway [ZONES...]
69
70
*`resources` a subset of supported Kubernetes resources to watch. Available options are `[ Ingress | Service | HTTPRoute | TLSRoute | GRPCRoute | DNSEndpoint ]`. If no resources are specified only `Ingress` and `Service` will be monitored
70
71
*`ingressClasses` to filter `Ingress` resources by `ingressClassName` values. Watches all by default.
71
72
*`gatewayClasses` to filter `Gateway` resources by `gatewayClassName` values. Watches all by default.
73
+
*`serviceLabelSelectors` to filter `Service` resources by labels using one or more [Kubernetes label selector](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors) strings. Each selector creates a separate watch; results are merged. Watches all by default.
72
74
*`ttl` can be used to override the default TTL value of 60 seconds.
73
75
*`apex` can be used to override the default apex record value of `{ReleaseName}-k8s-gateway.{Namespace}`
74
76
*`secondary` can be used to specify the optional apex record value of a peer nameserver running in the cluster (see `Dual Nameserver Deployment` section below).
0 commit comments