@@ -56,9 +56,12 @@ type GatewaySpec struct {
56
56
// Listeners associated with this Gateway. Listeners define what addresses,
57
57
// ports, protocols are bound on this Gateway.
58
58
Listeners []Listener `json:"listeners"`
59
- // Routes associated with this Gateway. Routes define
60
- // protocol-specific routing to backends (e.g. Services).
61
- Routes []core.TypedLocalObjectReference `json:"routes"`
59
+ // Routes defines routes to associate with the Gateway.
60
+ //
61
+ // Support: Core
62
+ //
63
+ // +optional
64
+ Routes []Route `json:"routes,omitempty"`
62
65
}
63
66
64
67
const (
@@ -68,6 +71,25 @@ const (
68
71
HTTPSProcotol = "HTTPS"
69
72
)
70
73
74
+ // Route defines the schema for a route.
75
+ type Route struct {
76
+ // RouteRef is a reference to an object to associate with the Gateway.
77
+ // RouteRef defines protocol-specific routing to back-ends (e.g. Services).
78
+ //
79
+ // If unspecified, no routes will be associated to the Gateway.
80
+ //
81
+ // Support: Core
82
+ //
83
+ // +optional
84
+ RouteRef core.ObjectReference `json:"routeRef"`
85
+ // TLS is the configuration used for establishing a TLS connection.
86
+ //
87
+ // Support: Core
88
+ //
89
+ // +optional
90
+ TLS * TLSConfig `json:"tls,omitempty"`
91
+ }
92
+
71
93
// Listener defines a
72
94
type Listener struct {
73
95
// Name is the listener's name and should be specified as an
@@ -87,7 +109,7 @@ type Listener struct {
87
109
// the request address is invalid, the GatewayClass MUST indicate
88
110
// this in the associated entry in GatewayStatus.Listeners.
89
111
//
90
- // Support:
112
+ // Support: Core
91
113
//
92
114
// +optional
93
115
Address * ListenerAddress `json:"address,omitempty"`
@@ -107,7 +129,7 @@ type Listener struct {
107
129
// Support: Core
108
130
//
109
131
// +optional
110
- TLS * ListenerTLS `json:"tls,omitempty"`
132
+ TLS * TLSConfig `json:"tls,omitempty"`
111
133
// Extension for this Listener.
112
134
//
113
135
// Support: custom.
@@ -149,7 +171,7 @@ const (
149
171
TLS1_3 = "TLS1_3"
150
172
)
151
173
152
- // ListenerTLS describes the TLS configuration for a given port .
174
+ // TLSConfig describes configuration for establishing a TLS connection .
153
175
//
154
176
// References
155
177
// - nginx: https://nginx.org/en/docs/http/configuring_https_servers.html
@@ -158,20 +180,41 @@ const (
158
180
// - gcp: https://cloud.google.com/load-balancing/docs/use-ssl-policies#creating_an_ssl_policy_with_a_custom_profile
159
181
// - aws: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies
160
182
// - azure: https://docs.microsoft.com/en-us/azure/app-service/configure-ssl-bindings#enforce-tls-1112
161
- type ListenerTLS struct {
183
+ type TLSConfig struct {
162
184
// Certificates is a reference to one or more Kubernetes objects each containing
163
- // an identity certificate that is bound to the listener. The hostname in a TLS
185
+ // an identity certificate that is bound to a listener. The hostname in a TLS
164
186
// SNI client hello message is used for certificate matching and route hostname
165
- // selection. The SNI server_name must match a route hostname for the Gateway to
166
- // route the TLS request.
187
+ // selection.
167
188
//
168
189
// If apiGroup and kind are empty, will default to Kubernetes Secrets resources.
169
190
//
170
191
// Support: Core (Kubernetes Secrets)
171
192
// Support: Implementation-specific (Other resource types)
172
193
//
173
- // +required
174
- Certificates []core.TypedLocalObjectReference `json:"certificates"`
194
+ // +optional
195
+ ListenerCertificates []core.TypedLocalObjectReference `json:"listenerCertificates,omitempty"`
196
+ // CACertificates is a reference to one or more Kubernetes objects
197
+ // each containing a CA certificate used by the TLS client for
198
+ // establishing a connection with a server.
199
+ //
200
+ // Here is a ConfigMap example (in yaml):
201
+ //
202
+ // apiVersion: v1
203
+ // kind: ConfigMap
204
+ // metadata:
205
+ // name: my-dest-svc-ca
206
+ // namespace: my-dest-svc-namespace
207
+ // data:
208
+ // ca-bundle.crt: |
209
+ // -----BEGIN CERTIFICATE-----
210
+ // Destination Service CA Certificate Bundle.
211
+ // -----END CERTIFICATE-----
212
+ //
213
+ // Support: Core (Kubernetes ConfigMap)
214
+ // Support: Implementation-specific (For other resource types)
215
+ //
216
+ // +optional
217
+ CACertificates []core.TypedLocalObjectReference `json:"caCertificates,omitempty"`
175
218
// MinimumVersion of TLS allowed. It is recommended to use one of
176
219
// the TLS_* constants above. Note: this is not strongly
177
220
// typed to allow implementation-specific versions to be used without
@@ -182,7 +225,15 @@ type ListenerTLS struct {
182
225
// values.
183
226
//
184
227
// +optional
185
- MinimumVersion * string `json:"minimumVersion"`
228
+ MinimumVersion * string `json:"minimumVersion,omitempty"`
229
+ // TLSTermination defines how to terminate TLS connections.
230
+ //
231
+ // If unspecified, TLS termination type "Edge" will be used.
232
+ //
233
+ // Support: Core
234
+ //
235
+ // +optional
236
+ TLSTermination TLSTerminationType `json:"tlsTermination,omitempty"`
186
237
// Options are a list of key/value pairs to give extended options
187
238
// to the provider.
188
239
//
@@ -192,9 +243,26 @@ type ListenerTLS struct {
192
243
// construct.
193
244
//
194
245
// Support: Implementation-specific.
195
- Options map [string ]string `json:"options"`
246
+ //
247
+ // +optional
248
+ Options map [string ]string `json:"options,omitempty"`
196
249
}
197
250
251
+ // TLSTerminationType specifies where TLS connections will terminate.
252
+ type TLSTerminationType string
253
+
254
+ const (
255
+ // TLSTerminationEdge terminates the TLS connection at the gateway.
256
+ TLSTerminationEdge TLSTerminationType = "Edge"
257
+
258
+ // TLSTerminationPassthrough terminates the TLS connection at the
259
+ // destination service. The destination service is responsible for
260
+ // decrypting data from the connection. The Gateway listener must be
261
+ // configured for the HTTPS protocol. SNI is used by the Gateway to
262
+ // perform route selection.
263
+ TLSTerminationPassthrough TLSTerminationType = "Passthrough"
264
+ )
265
+
198
266
// GatewayStatus defines the observed state of Gateway.
199
267
type GatewayStatus struct {
200
268
// Conditions describe the current conditions of the Gateway.
0 commit comments