Skip to content

Commit 2bb1b13

Browse files
committed
Addressing feedback
1 parent 7401fa1 commit 2bb1b13

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

docs/guide/gateway/customization.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ This configuration can then be applied by attaching the `LoadBalancerConfigurati
2727
**Attaching to a Gateway:**
2828
When attached directly to a `Gateway` resource, the specified configuration applies specifically to the Load Balancer provisioned for that individual Gateway.
2929

30+
!!! note
31+
Make sure that the `LoadBalancerConfiguration` must be in same namepace as the `Gateway`.
32+
3033
```yaml
3134
apiVersion: gateway.networking.k8s.io/v1
3235
kind: Gateway
@@ -63,7 +66,7 @@ spec:
6366

6467
#### Conflict Resolution for `LoadBalancerConfiguration`
6568

66-
It is possible for a `LoadBalancerConfiguration` to be attached to both a `Gateway` and its associated `GatewayClass`. In such scenarios, when identical fields are specified in both configurations, the LBC employs a merging algorithm to resolve conflicts. The precedence of values is determined by the `mergingMode` field, which is exclusively read from the `GatewayClass`'s `LoadBalancerConfiguration`. If `mergingMode` is not explicitly set, the `GatewayClass` configuration implicitly takes higher precedence.
69+
It is possible for a `LoadBalancerConfiguration` to be attached to both a `Gateway` and its associated `GatewayClass`. In such scenarios, when identical fields are specified in both configurations, the LBC employs a merging algorithm to resolve conflicts. The precedence of values is determined by the `mergingMode` field, which is exclusively read from the `GatewayClass`'s `LoadBalancerConfiguration`. If `mergingMode` is not explicitly set, the `GatewayClass` configuration implicitly takes higher precedence. For more info on `mergingMode`, refer this [doc](../loadbalancerconfig/#mergingmode)
6770

6871
The following fields exhibit specific merge behaviors:
6972

docs/guide/gateway/gateway.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Mixing protocol layers, e.g. TCPRoute and HTTPRoute on the same Gateway, is not
1717

1818
The LBC Gateway API implementation supports the following Gateway API routes:
1919

20-
* L4 (NLBGatewayApi): UDPRoute, TCPRoute, TLSRoute >=v2.13.3
21-
* L7 (ALBGatewayApi): HTTPRoute
20+
* L4 (NLBGatewayAPI): UDPRoute, TCPRoute, TLSRoute >=v2.13.3
21+
* L7 (ALBGatewayAPI): HTTPRoute (Still work in progress, support matching and filtering is not added yet!)
2222

2323
## Prerequisites
2424
* LBC >= v2.13.0

docs/guide/gateway/l4gateway.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ The LBC instances dedicated to L4 routing monitor the following Gateway API reso
1313
* **`TLSRoute`**: Defines TLS-specific routing rules, enabling secure Layer 4 communication. These routes are satisfied by an **AWS NLB**.
1414
* **`TCPRoute`**: Defines TCP-specific routing rules, facilitating direct TCP traffic management. These routes are satisfied by an **AWS NLB**.
1515
* **`UDPRoute`**: Defines UDP-specific routing rules, facilitating UDP traffic management. These routes are satisfied by an **AWS NLB**.
16-
* **`LoadBalancerConfiguration` (CRD)**: A Custom Resource Definition utilized for fine-grained customization of the provisioned NLB. This CRD can be attached to a `Gateway` or its `GatewayClass`. For more info, please refer [How customization works](../customization)
17-
* **`TargetGroupConfiguration` (CRD)**: A Custom Resource Definition used for service-specific customizations of AWS Target Groups. This CRD is associated with a Kubernetes `Service`. For more info, please refer [How customization works](../customization)
16+
* **`LoadBalancerConfiguration` (LBC CRD)**: A Custom Resource Definition utilized for fine-grained customization of the provisioned NLB. This CRD can be attached to a `Gateway` or its `GatewayClass`. For more info, please refer [How customization works](../customization)
17+
* **`TargetGroupConfiguration` (LBC CRD)**: A Custom Resource Definition used for service-specific customizations of AWS Target Groups. This CRD is associated with a Kubernetes `Service`. For more info, please refer [How customization works](../customization)
1818

1919
### The Reconciliation Loop
2020

2121
The LBC operates on a continuous **reconciliation loop** within your cluster to maintain the desired state of AWS Load Balancer resources:
2222

23-
1. **Event Watching:** The L4-specific controller instance constantly monitors the Kubernetes API for changes to `GatewayClass`, `Gateway`, `TCPRoute`, `UDPRoute`, `TLSRoute`, `Services`, `LoadBalancerConfiguration`, and `TargetGroupConfiguration` resources relevant to NLB provisioning.
23+
1. **Event Watching:** The L4-specific controller instance constantly monitors the Kubernetes API for changes to the resources mentioned above to NLB provisioning.
2424
2. **Queueing:** Upon detecting any modification, creation, or deletion of these resources, the respective object is added to an internal processing queue.
2525
3. **Processing:**
2626
* The controller retrieves the resource from the queue.
@@ -89,13 +89,13 @@ The LBC implementation of the Gateway API for L4 routes, which provisions NLB, i
8989

9090
#### Single Route Per L4 Gateway Listener:
9191

92-
**Limitation**: Each L4 Gateway Listener (configured via a Gateway resource for TCP, UDP, or TLS protocols) is designed to handle traffic for precisely one L4 Route resource (TCPRoute, UDPRoute, or TLSRoute). The controller does not support scenarios where multiple Route resources attempt to attach to the same L4 Gateway Listener.
92+
**Limitation**: Each L4 Gateway Listener (configured via a Gateway resource for TCP, UDP, or TLS protocols) is designed to handle traffic for precisely one L4 Route resource (TCPRoute, UDPRoute, or TLSRoute). The controller does not support scenarios where multiple Route resources attempt to attach to the same L4 Gateway Listener and will throw a validation error during reconcile.
9393

9494
**Reasoning**: This constraint simplifies L4 listener rule management on NLBs, which primarily offer a default action for a given port/protocol.
9595

9696
#### Single Backend Reference Per L4 Route:
9797

98-
**Limitation**: Each L4 Route resource (TCPRoute, UDPRoute, or TLSRoute) must specify exactly one backend reference (backendRef). The controller explicitly disallows routes with zero or more than one backendRef.
98+
**Limitation**: Each L4 Route resource (TCPRoute, UDPRoute, or TLSRoute) must specify exactly one backend reference (backendRef). The controller explicitly disallows routes with zero or more than one backendRef throwing a validation error during reconcile
9999

100100
**Reasoning**: Unlike ALBs which support weighted target groups for traffic splitting across multiple backends, NLBs primarily forward traffic to a single target group for a given listener's default action. This aligns the LBC's L4 route translation with NLB's inherent capabilities, where weighted target groups are not a native feature for directly splitting traffic across multiple services on a single listener.
101101

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ require (
4242
k8s.io/client-go v0.33.1
4343
k8s.io/klog/v2 v2.130.1
4444
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
45-
sigs.k8s.io/controller-runtime v0.19.3
45+
sigs.k8s.io/controller-runtime v0.21.0
4646
sigs.k8s.io/gateway-api v1.2.0
4747
sigs.k8s.io/yaml v1.4.0
4848
)
@@ -85,11 +85,12 @@ require (
8585
github.com/docker/go-connections v0.5.0 // indirect
8686
github.com/docker/go-metrics v0.0.1 // indirect
8787
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
88-
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
88+
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
8989
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
9090
github.com/fatih/color v1.18.0 // indirect
9191
github.com/fatih/structs v1.1.0 // indirect
9292
github.com/felixge/httpsnoop v1.0.4 // indirect
93+
github.com/fsnotify/fsnotify v1.7.0 // indirect
9394
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
9495
github.com/go-errors/errors v1.4.2 // indirect
9596
github.com/go-gorp/gorp/v3 v3.1.0 // indirect

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ github.com/evanphx/json-patch v5.9.0+incompatible h1:fBXyNpNMuTTDdquAq/uisOr2lSh
149149
github.com/evanphx/json-patch v5.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
150150
github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg=
151151
github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=
152+
github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU=
153+
github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM=
152154
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f h1:Wl78ApPPB2Wvf/TIe2xdyJxTlb6obmF18d8QdkxNDu4=
153155
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f/go.mod h1:OSYXu++VVOHnXeitef/D8n/6y4QV8uLHSFXX4NeXMGc=
154156
github.com/fasthttp/websocket v1.4.3-rc.6 h1:omHqsl8j+KXpmzRjF8bmzOSYJ8GnS0E3efi1wYT+niY=
@@ -655,6 +657,8 @@ oras.land/oras-go v1.2.5 h1:XpYuAwAb0DfQsunIyMfeET92emK8km3W4yEzZvUbsTo=
655657
oras.land/oras-go v1.2.5/go.mod h1:PuAwRShRZCsZb7g8Ar3jKKQR/2A/qN+pkYxIOd/FAoo=
656658
sigs.k8s.io/controller-runtime v0.19.3 h1:XO2GvC9OPftRst6xWCpTgBZO04S2cbp0Qqkj8bX1sPw=
657659
sigs.k8s.io/controller-runtime v0.19.3/go.mod h1:j4j87DqtsThvwTv5/Tc5NFRyyF/RF0ip4+62tbTSIUM=
660+
sigs.k8s.io/controller-runtime v0.21.0 h1:CYfjpEuicjUecRk+KAeyYh+ouUBn4llGyDYytIGcJS8=
661+
sigs.k8s.io/controller-runtime v0.21.0/go.mod h1:OSg14+F65eWqIu4DceX7k/+QRAbTTvxeQSNSOQpukWM=
658662
sigs.k8s.io/gateway-api v1.2.0 h1:LrToiFwtqKTKZcZtoQPTuo3FxhrrhTgzQG0Te+YGSo8=
659663
sigs.k8s.io/gateway-api v1.2.0/go.mod h1:EpNfEXNjiYfUJypf0eZ0P5iXA9ekSGWaS1WgPaM42X0=
660664
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=

0 commit comments

Comments
 (0)