@@ -19,7 +19,7 @@ pub struct GatewaySpec {
19
19
/// GatewayClass resource.
20
20
pub gateway_class_name : ObjectName ,
21
21
22
- // Listeners associated with this Gateway. Listeners define logical
22
+ /// Listeners associated with this Gateway. Listeners define logical
23
23
/// endpoints that are bound on this Gateway's addresses. At least one
24
24
/// Listener MUST be specified.
25
25
///
@@ -59,29 +59,29 @@ pub struct GatewaySpec {
59
59
/// Support: Core
60
60
pub listeners : Vec < Listener > ,
61
61
62
- // Addresses requested for this Gateway. This is optional and behavior can
63
- // depend on the implementation. If a value is set in the spec and the
64
- // requested address is invalid or unavailable, the implementation MUST
65
- // indicate this in the associated entry in GatewayStatus.Addresses.
66
- //
67
- // The Addresses field represents a request for the address(es) on the
68
- // "outside of the Gateway", that traffic bound for this Gateway will use.
69
- // This could be the IP address or hostname of an external load balancer or
70
- // other networking infrastructure, or some other address that traffic will
71
- // be sent to.
72
- //
73
- // The .listener.hostname field is used to route traffic that has already
74
- // arrived at the Gateway to the correct in-cluster destination.
75
- //
76
- // If no Addresses are specified, the implementation MAY schedule the
77
- // Gateway in an implementation-specific manner, assigning an appropriate
78
- // set of Addresses.
79
- //
80
- // The implementation MUST bind all Listeners to every GatewayAddress that
81
- // it assigns to the Gateway and add a corresponding entry in
82
- // GatewayStatus.Addresses.
83
- //
84
- // Support: Extended
62
+ /// Addresses requested for this Gateway. This is optional and behavior can
63
+ /// depend on the implementation. If a value is set in the spec and the
64
+ /// requested address is invalid or unavailable, the implementation MUST
65
+ /// indicate this in the associated entry in GatewayStatus.Addresses.
66
+ ///
67
+ /// The Addresses field represents a request for the address(es) on the
68
+ /// "outside of the Gateway", that traffic bound for this Gateway will use.
69
+ /// This could be the IP address or hostname of an external load balancer or
70
+ /// other networking infrastructure, or some other address that traffic will
71
+ /// be sent to.
72
+ ///
73
+ /// The .listener.hostname field is used to route traffic that has already
74
+ /// arrived at the Gateway to the correct in-cluster destination.
75
+ ///
76
+ /// If no Addresses are specified, the implementation MAY schedule the
77
+ /// Gateway in an implementation-specific manner, assigning an appropriate
78
+ /// set of Addresses.
79
+ ///
80
+ /// The implementation MUST bind all Listeners to every GatewayAddress that
81
+ /// it assigns to the Gateway and add a corresponding entry in
82
+ /// GatewayStatus.Addresses.
83
+ ///
84
+ /// Support: Extended
85
85
pub addresses : Option < Vec < GatewayAddress > > ,
86
86
}
87
87
@@ -129,8 +129,43 @@ pub struct Listener {
129
129
/// Support: Core
130
130
pub protocol : ProtocolType ,
131
131
132
+ /// TLS is the TLS configuration for the Listener. This field is required if
133
+ /// the Protocol field is "HTTPS" or "TLS". It is invalid to set this field
134
+ /// if the Protocol field is "HTTP", "TCP", or "UDP".
135
+ ///
136
+ /// The association of SNIs to Certificate defined in GatewayTLSConfig is
137
+ /// defined based on the Hostname field for this listener.
138
+ ///
139
+ /// The GatewayClass MUST use the longest matching SNI out of all available
140
+ /// certificates for any TLS handshake.
141
+ ///
142
+ /// Support: Core
132
143
pub tls : Option < GatewayTlsConfig > ,
133
144
145
+ /// AllowedRoutes defines the types of routes that MAY be attached to a
146
+ /// Listener and the trusted namespaces where those Route resources MAY be
147
+ /// present.
148
+ ///
149
+ /// Although a client request may match multiple route rules, only one rule
150
+ /// may ultimately receive the request. Matching precedence MUST be
151
+ /// determined in order of the following criteria:
152
+ ///
153
+ /// * The most specific match as defined by the Route type.
154
+ /// * The oldest Route based on creation timestamp. For example, a Route
155
+ /// with a creation timestamp of "2020-09-08 01:02:03" is given precedence
156
+ /// over a Route with a creation timestamp of "2020-09-08 01:02:04".
157
+ /// * If everything else is equivalent, the Route appearing first in
158
+ /// alphabetical order (namespace/name) should be given precedence. For
159
+ /// example, foo/bar is given precedence over foo/baz.
160
+ ///
161
+ /// All valid rules within a Route attached to this Listener should be
162
+ /// implemented. Invalid Route rules can be ignored (sometimes that will
163
+ /// mean the full Route). If a Route rule transitions from valid to invalid,
164
+ /// support for that Route rule should be dropped to ensure consistency. For
165
+ /// example, even if a filter specified by a Route rule is invalid, the rest
166
+ /// of the rules within that Route should still be supported.
167
+ ///
168
+ /// Support: Core
134
169
pub allowed_routes : Option < AllowedRoutes > ,
135
170
}
136
171
@@ -222,6 +257,7 @@ pub struct GatewayTlsConfig {
222
257
/// TLSModeType type defines how a Gateway handles TLS sessions.
223
258
pub type TlsModeType = String ;
224
259
260
+ /// AllowedRoutes defines which Routes may be attached to this Listener.
225
261
#[ derive( Clone , Debug , PartialEq , serde:: Deserialize , serde:: Serialize , schemars:: JsonSchema ) ]
226
262
#[ serde( rename_all = "camelCase" ) ]
227
263
pub struct AllowedRoutes {
@@ -250,13 +286,28 @@ pub struct AllowedRoutes {
250
286
/// Gateway.
251
287
pub type FromNamespaces = String ;
252
288
289
+ /// RouteNamespaces indicate which namespaces Routes should be selected from.
253
290
#[ derive( Clone , Debug , PartialEq , serde:: Deserialize , serde:: Serialize , schemars:: JsonSchema ) ]
254
291
pub struct RouteNamespaces {
292
+ /// From indicates where Routes will be selected for this Gateway. Possible
293
+ /// values are:
294
+ /// * All: Routes in all namespaces may be used by this Gateway.
295
+ /// * Selector: Routes in namespaces selected by the selector may be used by
296
+ /// this Gateway.
297
+ /// * Same: Only Routes in the same namespace may be used by this Gateway.
298
+ ///
299
+ /// Support: Core
255
300
pub from : Option < FromNamespaces > ,
256
301
257
- pub selector : metav1:: LabelSelector ,
302
+ /// Selector must be specified when From is set to "Selector". In that case,
303
+ /// only Routes in Namespaces matching this Selector will be selected by this
304
+ /// Gateway. This field is ignored for other values of "From".
305
+ ///
306
+ /// Support: Core
307
+ pub selector : Option < metav1:: LabelSelector > ,
258
308
}
259
309
310
+ /// RouteGroupKind indicates the group and kind of a Route resource.
260
311
#[ derive( Clone , Debug , PartialEq , serde:: Deserialize , serde:: Serialize , schemars:: JsonSchema ) ]
261
312
pub struct RouteGroupKind {
262
313
/// Group is the group of the Route.
@@ -266,6 +317,7 @@ pub struct RouteGroupKind {
266
317
pub kind : String ,
267
318
}
268
319
320
+ /// GatewayAddress describes an address that can be bound to a Gateway.
269
321
#[ derive( Clone , Debug , PartialEq , serde:: Deserialize , serde:: Serialize , schemars:: JsonSchema ) ]
270
322
pub struct GatewayAddress {
271
323
/// Type of the address.
@@ -278,6 +330,7 @@ pub struct GatewayAddress {
278
330
pub value : String ,
279
331
}
280
332
333
+ /// GatewayStatus defines the observed state of Gateway.
281
334
#[ derive( Clone , Debug , PartialEq , serde:: Deserialize , serde:: Serialize , schemars:: JsonSchema ) ]
282
335
pub struct GatewayStatus {
283
336
/// Addresses lists the IP addresses that have actually been bound to the
@@ -302,10 +355,16 @@ pub struct GatewayStatus {
302
355
pub listeners : Option < Vec < ListenerStatus > > ,
303
356
}
304
357
358
+ /// GatewayConditionType is a type of condition associated with a
359
+ /// Gateway. This type should be used with the GatewayStatus.Conditions
360
+ /// field.
305
361
pub type GatewayConditionType = String ;
306
362
363
+ /// GatewayConditionReason defines the set of reasons that explain why a
364
+ /// particular Gateway condition type has been raised.
307
365
pub type GatewayConditionReason = String ;
308
366
367
+ /// ListenerStatus is the status associated with a Listener.
309
368
#[ derive( Clone , Debug , PartialEq , serde:: Deserialize , serde:: Serialize , schemars:: JsonSchema ) ]
310
369
pub struct ListenerStatus {
311
370
/// Name is the name of the Listener that this status corresponds to.
@@ -330,6 +389,10 @@ pub struct ListenerStatus {
330
389
pub conditions : Vec < metav1:: Condition > ,
331
390
}
332
391
392
+ /// ListenerConditionType is a type of condition associated with the listener.
393
+ /// This type should be used with the ListenerStatus.Conditions field.
333
394
pub type ListenerConditionType = String ;
334
395
396
+ /// ListenerConditionReason defines the set of reasons that explain why a
397
+ /// particular Listener condition type has been raised.
335
398
pub type ListenerConditionReason = String ;
0 commit comments