@@ -19,7 +19,7 @@ pub struct GatewaySpec {
1919 /// GatewayClass resource.
2020 pub gateway_class_name : ObjectName ,
2121
22- // Listeners associated with this Gateway. Listeners define logical
22+ /// Listeners associated with this Gateway. Listeners define logical
2323 /// endpoints that are bound on this Gateway's addresses. At least one
2424 /// Listener MUST be specified.
2525 ///
@@ -59,29 +59,29 @@ pub struct GatewaySpec {
5959 /// Support: Core
6060 pub listeners : Vec < Listener > ,
6161
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
8585 pub addresses : Option < Vec < GatewayAddress > > ,
8686}
8787
@@ -129,8 +129,43 @@ pub struct Listener {
129129 /// Support: Core
130130 pub protocol : ProtocolType ,
131131
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
132143 pub tls : Option < GatewayTlsConfig > ,
133144
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
134169 pub allowed_routes : Option < AllowedRoutes > ,
135170}
136171
@@ -222,6 +257,7 @@ pub struct GatewayTlsConfig {
222257/// TLSModeType type defines how a Gateway handles TLS sessions.
223258pub type TlsModeType = String ;
224259
260+ /// AllowedRoutes defines which Routes may be attached to this Listener.
225261#[ derive( Clone , Debug , PartialEq , serde:: Deserialize , serde:: Serialize , schemars:: JsonSchema ) ]
226262#[ serde( rename_all = "camelCase" ) ]
227263pub struct AllowedRoutes {
@@ -250,13 +286,28 @@ pub struct AllowedRoutes {
250286/// Gateway.
251287pub type FromNamespaces = String ;
252288
289+ /// RouteNamespaces indicate which namespaces Routes should be selected from.
253290#[ derive( Clone , Debug , PartialEq , serde:: Deserialize , serde:: Serialize , schemars:: JsonSchema ) ]
254291pub 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
255300 pub from : Option < FromNamespaces > ,
256301
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 > ,
258308}
259309
310+ /// RouteGroupKind indicates the group and kind of a Route resource.
260311#[ derive( Clone , Debug , PartialEq , serde:: Deserialize , serde:: Serialize , schemars:: JsonSchema ) ]
261312pub struct RouteGroupKind {
262313 /// Group is the group of the Route.
@@ -266,6 +317,7 @@ pub struct RouteGroupKind {
266317 pub kind : String ,
267318}
268319
320+ /// GatewayAddress describes an address that can be bound to a Gateway.
269321#[ derive( Clone , Debug , PartialEq , serde:: Deserialize , serde:: Serialize , schemars:: JsonSchema ) ]
270322pub struct GatewayAddress {
271323 /// Type of the address.
@@ -278,6 +330,7 @@ pub struct GatewayAddress {
278330 pub value : String ,
279331}
280332
333+ /// GatewayStatus defines the observed state of Gateway.
281334#[ derive( Clone , Debug , PartialEq , serde:: Deserialize , serde:: Serialize , schemars:: JsonSchema ) ]
282335pub struct GatewayStatus {
283336 /// Addresses lists the IP addresses that have actually been bound to the
@@ -302,10 +355,16 @@ pub struct GatewayStatus {
302355 pub listeners : Option < Vec < ListenerStatus > > ,
303356}
304357
358+ /// GatewayConditionType is a type of condition associated with a
359+ /// Gateway. This type should be used with the GatewayStatus.Conditions
360+ /// field.
305361pub type GatewayConditionType = String ;
306362
363+ /// GatewayConditionReason defines the set of reasons that explain why a
364+ /// particular Gateway condition type has been raised.
307365pub type GatewayConditionReason = String ;
308366
367+ /// ListenerStatus is the status associated with a Listener.
309368#[ derive( Clone , Debug , PartialEq , serde:: Deserialize , serde:: Serialize , schemars:: JsonSchema ) ]
310369pub struct ListenerStatus {
311370 /// Name is the name of the Listener that this status corresponds to.
@@ -330,6 +389,10 @@ pub struct ListenerStatus {
330389 pub conditions : Vec < metav1:: Condition > ,
331390}
332391
392+ /// ListenerConditionType is a type of condition associated with the listener.
393+ /// This type should be used with the ListenerStatus.Conditions field.
333394pub type ListenerConditionType = String ;
334395
396+ /// ListenerConditionReason defines the set of reasons that explain why a
397+ /// particular Listener condition type has been raised.
335398pub type ListenerConditionReason = String ;
0 commit comments