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
Copy file name to clipboardExpand all lines: docs/guide/gateway/l4gateway.md
+89Lines changed: 89 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,95 @@ spec:
85
85
* **L4 Listener Materialization:** The controller processes the `my-tcp-app-route` resource. Given that the `TCPRoute` validly references the `my-tcp-gateway` and its `tcp-app` listener, an **NLB Listener** is materialized on the provisioned NLB. This listener will be configured for `TCP` protocol on `port 8080`, as specified in the `Gateway`'s listener definition. A default forward action is subsequently configured on the NLB Listener, directing all incoming traffic on `port 8080` to the newly created Target Group for service `my-tcp-service` in `backendRefs` section of `my-tcp-app-route`.
86
86
* **Target Group Creation:** An **AWS Target Group** is created for the Kubernetes Service `my-tcp-service` with default configuration. The cluster nodes are then registered as targets within this new Target Group.
87
87
88
+
89
+
### Combined Protocols
90
+
AWS NLB supports combining TCP and UDP on the same listener; the protocol is called TCP_UDP. This powerful
91
+
paradigm allows the load balancer to serve different protocols for different applications on the same listener port.
92
+
The LBC implements this protocol merging capability.
93
+
94
+
#### Combined protocol quirks
95
+
96
+
AWS NLB assumes that in a combined protocol set up,
97
+
all targets are able to serve both protocols. To prevent configuration duplication, we follow this same pattern for constructing
98
+
the combined protocol listener. TCP_UDP listeners are able to attach routes of type TCP and UDP, each route attached
99
+
generates a TCP_UDP target group.
100
+
101
+
102
+
#### Combined protocol examples
103
+
104
+
```yaml
105
+
apiVersion: gateway.networking.k8s.io/v1
106
+
kind: Gateway
107
+
metadata:
108
+
name: my-tcp-udp-gateway
109
+
namespace: tcp-udp
110
+
spec:
111
+
gatewayClassName: aws-nlb-gateway-class
112
+
listeners:
113
+
- allowedRoutes:
114
+
namespaces:
115
+
from: Same
116
+
name: tcp-app
117
+
port: 80
118
+
protocol: TCP
119
+
- allowedRoutes:
120
+
namespaces:
121
+
from: Same
122
+
name: udp-app
123
+
port: 80
124
+
protocol: UDP
125
+
---
126
+
apiVersion: gateway.networking.k8s.io/v1alpha2
127
+
kind: UDPRoute
128
+
metadata:
129
+
name: my-udp-app-route
130
+
namespace: tcp-udp
131
+
spec:
132
+
parentRefs:
133
+
- group: gateway.networking.k8s.io
134
+
kind: Gateway
135
+
name: my-tcp-udp-gateway
136
+
sectionName: udp-app
137
+
rules:
138
+
- backendRefs:
139
+
- group: ""
140
+
kind: Service
141
+
name: udpechoserver
142
+
port: 8080
143
+
weight: 1
144
+
```
145
+
146
+
To customize the target group created, it's no different from a single protocol
147
+
```yaml
148
+
apiVersion: gateway.k8s.aws/v1beta1
149
+
kind: TargetGroupConfiguration
150
+
metadata:
151
+
name: example-tg-config
152
+
namespace: tcp-udp
153
+
spec:
154
+
defaultConfiguration:
155
+
targetType: ip
156
+
targetReference:
157
+
group: ""
158
+
kind: Service
159
+
name: udpechoserver
160
+
```
161
+
162
+
To customize the listener:
163
+
```yaml
164
+
apiVersion: gateway.k8s.aws/v1beta1
165
+
kind: LoadBalancerConfiguration
166
+
metadata:
167
+
name: nlb-lb-config
168
+
namespace: tcp-udp
169
+
spec:
170
+
listenerConfigurations:
171
+
- protocolPort: TCP_UDP:80
172
+
listenerAttributes:
173
+
- key: tcp.idle_timeout.seconds
174
+
value: "60"
175
+
```
176
+
88
177
### L4 Gateway API Limitations for NLBs
89
178
The LBC implementation of the Gateway API for L4 routes, which provisions NLB, introduces specific constraints to align with NLB capabilities. These limitations are enforced during the reconciliation process and are critical for successful L4 traffic management.
0 commit comments