gateway_api/apis/standard/gateways.rs
1// WARNING: generated file - manual changes will be overriden
2
3use super::common::*;
4#[allow(unused_imports)]
5mod prelude {
6 pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
7 pub use kube_derive::CustomResource;
8 pub use schemars::JsonSchema;
9 pub use serde::{Deserialize, Serialize};
10 pub use std::collections::BTreeMap;
11}
12use self::prelude::*;
13/// Spec defines the desired state of Gateway.
14#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
15#[kube(
16 group = "gateway.networking.k8s.io",
17 version = "v1",
18 kind = "Gateway",
19 plural = "gateways"
20)]
21#[kube(namespaced)]
22#[kube(status = "GatewayStatus")]
23#[kube(derive = "Default")]
24#[kube(derive = "PartialEq")]
25pub struct GatewaySpec {
26 /// Addresses requested for this Gateway. This is optional and behavior can
27 /// depend on the implementation. If a value is set in the spec and the
28 /// requested address is invalid or unavailable, the implementation MUST
29 /// indicate this in the associated entry in GatewayStatus.Addresses.
30 ///
31 /// The Addresses field represents a request for the address(es) on the
32 /// "outside of the Gateway", that traffic bound for this Gateway will use.
33 /// This could be the IP address or hostname of an external load balancer or
34 /// other networking infrastructure, or some other address that traffic will
35 /// be sent to.
36 ///
37 /// If no Addresses are specified, the implementation MAY schedule the
38 /// Gateway in an implementation-specific manner, assigning an appropriate
39 /// set of Addresses.
40 ///
41 /// The implementation MUST bind all Listeners to every GatewayAddress that
42 /// it assigns to the Gateway and add a corresponding entry in
43 /// GatewayStatus.Addresses.
44 ///
45 /// Support: Extended
46 ///
47 ///
48 #[serde(default, skip_serializing_if = "Option::is_none")]
49 pub addresses: Option<Vec<GatewayAddress>>,
50 /// GatewayClassName used for this Gateway. This is the name of a
51 /// GatewayClass resource.
52 #[serde(rename = "gatewayClassName")]
53 pub gateway_class_name: String,
54 /// Infrastructure defines infrastructure level attributes about this Gateway instance.
55 ///
56 /// Support: Extended
57 #[serde(default, skip_serializing_if = "Option::is_none")]
58 pub infrastructure: Option<GatewayInfrastructure>,
59 /// Listeners associated with this Gateway. Listeners define
60 /// logical endpoints that are bound on this Gateway's addresses.
61 /// At least one Listener MUST be specified.
62 ///
63 /// Each Listener in a set of Listeners (for example, in a single Gateway)
64 /// MUST be _distinct_, in that a traffic flow MUST be able to be assigned to
65 /// exactly one listener. (This section uses "set of Listeners" rather than
66 /// "Listeners in a single Gateway" because implementations MAY merge configuration
67 /// from multiple Gateways onto a single data plane, and these rules _also_
68 /// apply in that case).
69 ///
70 /// Practically, this means that each listener in a set MUST have a unique
71 /// combination of Port, Protocol, and, if supported by the protocol, Hostname.
72 ///
73 /// Some combinations of port, protocol, and TLS settings are considered
74 /// Core support and MUST be supported by implementations based on their
75 /// targeted conformance profile:
76 ///
77 /// HTTP Profile
78 ///
79 /// 1. HTTPRoute, Port: 80, Protocol: HTTP
80 /// 2. HTTPRoute, Port: 443, Protocol: HTTPS, TLS Mode: Terminate, TLS keypair provided
81 ///
82 /// TLS Profile
83 ///
84 /// 1. TLSRoute, Port: 443, Protocol: TLS, TLS Mode: Passthrough
85 ///
86 /// "Distinct" Listeners have the following property:
87 ///
88 /// The implementation can match inbound requests to a single distinct
89 /// Listener. When multiple Listeners share values for fields (for
90 /// example, two Listeners with the same Port value), the implementation
91 /// can match requests to only one of the Listeners using other
92 /// Listener fields.
93 ///
94 /// For example, the following Listener scenarios are distinct:
95 ///
96 /// 1. Multiple Listeners with the same Port that all use the "HTTP"
97 /// Protocol that all have unique Hostname values.
98 /// 2. Multiple Listeners with the same Port that use either the "HTTPS" or
99 /// "TLS" Protocol that all have unique Hostname values.
100 /// 3. A mixture of "TCP" and "UDP" Protocol Listeners, where no Listener
101 /// with the same Protocol has the same Port value.
102 ///
103 /// Some fields in the Listener struct have possible values that affect
104 /// whether the Listener is distinct. Hostname is particularly relevant
105 /// for HTTP or HTTPS protocols.
106 ///
107 /// When using the Hostname value to select between same-Port, same-Protocol
108 /// Listeners, the Hostname value must be different on each Listener for the
109 /// Listener to be distinct.
110 ///
111 /// When the Listeners are distinct based on Hostname, inbound request
112 /// hostnames MUST match from the most specific to least specific Hostname
113 /// values to choose the correct Listener and its associated set of Routes.
114 ///
115 /// Exact matches must be processed before wildcard matches, and wildcard
116 /// matches must be processed before fallback (empty Hostname value)
117 /// matches. For example, `"foo.example.com"` takes precedence over
118 /// `"*.example.com"`, and `"*.example.com"` takes precedence over `""`.
119 ///
120 /// Additionally, if there are multiple wildcard entries, more specific
121 /// wildcard entries must be processed before less specific wildcard entries.
122 /// For example, `"*.foo.example.com"` takes precedence over `"*.example.com"`.
123 /// The precise definition here is that the higher the number of dots in the
124 /// hostname to the right of the wildcard character, the higher the precedence.
125 ///
126 /// The wildcard character will match any number of characters _and dots_ to
127 /// the left, however, so `"*.example.com"` will match both
128 /// `"foo.bar.example.com"` _and_ `"bar.example.com"`.
129 ///
130 /// If a set of Listeners contains Listeners that are not distinct, then those
131 /// Listeners are Conflicted, and the implementation MUST set the "Conflicted"
132 /// condition in the Listener Status to "True".
133 ///
134 /// Implementations MAY choose to accept a Gateway with some Conflicted
135 /// Listeners only if they only accept the partial Listener set that contains
136 /// no Conflicted Listeners. To put this another way, implementations may
137 /// accept a partial Listener set only if they throw out *all* the conflicting
138 /// Listeners. No picking one of the conflicting listeners as the winner.
139 /// This also means that the Gateway must have at least one non-conflicting
140 /// Listener in this case, otherwise it violates the requirement that at
141 /// least one Listener must be present.
142 ///
143 /// The implementation MUST set a "ListenersNotValid" condition on the
144 /// Gateway Status when the Gateway contains Conflicted Listeners whether or
145 /// not they accept the Gateway. That Condition SHOULD clearly
146 /// indicate in the Message which Listeners are conflicted, and which are
147 /// Accepted. Additionally, the Listener status for those listeners SHOULD
148 /// indicate which Listeners are conflicted and not Accepted.
149 ///
150 /// A Gateway's Listeners are considered "compatible" if:
151 ///
152 /// 1. They are distinct.
153 /// 2. The implementation can serve them in compliance with the Addresses
154 /// requirement that all Listeners are available on all assigned
155 /// addresses.
156 ///
157 /// Compatible combinations in Extended support are expected to vary across
158 /// implementations. A combination that is compatible for one implementation
159 /// may not be compatible for another.
160 ///
161 /// For example, an implementation that cannot serve both TCP and UDP listeners
162 /// on the same address, or cannot mix HTTPS and generic TLS listens on the same port
163 /// would not consider those cases compatible, even though they are distinct.
164 ///
165 /// Note that requests SHOULD match at most one Listener. For example, if
166 /// Listeners are defined for "foo.example.com" and "*.example.com", a
167 /// request to "foo.example.com" SHOULD only be routed using routes attached
168 /// to the "foo.example.com" Listener (and not the "*.example.com" Listener).
169 /// This concept is known as "Listener Isolation". Implementations that do
170 /// not support Listener Isolation MUST clearly document this.
171 ///
172 /// Implementations MAY merge separate Gateways onto a single set of
173 /// Addresses if all Listeners across all Gateways are compatible.
174 ///
175 /// Support: Core
176 pub listeners: Vec<GatewayListeners>,
177}
178/// Infrastructure defines infrastructure level attributes about this Gateway instance.
179///
180/// Support: Extended
181#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
182pub struct GatewayInfrastructure {
183 /// Annotations that SHOULD be applied to any resources created in response to this Gateway.
184 ///
185 /// For implementations creating other Kubernetes objects, this should be the `metadata.annotations` field on resources.
186 /// For other implementations, this refers to any relevant (implementation specific) "annotations" concepts.
187 ///
188 /// An implementation may chose to add additional implementation-specific annotations as they see fit.
189 ///
190 /// Support: Extended
191 #[serde(default, skip_serializing_if = "Option::is_none")]
192 pub annotations: Option<BTreeMap<String, String>>,
193 /// Labels that SHOULD be applied to any resources created in response to this Gateway.
194 ///
195 /// For implementations creating other Kubernetes objects, this should be the `metadata.labels` field on resources.
196 /// For other implementations, this refers to any relevant (implementation specific) "labels" concepts.
197 ///
198 /// An implementation may chose to add additional implementation-specific labels as they see fit.
199 ///
200 /// If an implementation maps these labels to Pods, or any other resource that would need to be recreated when labels
201 /// change, it SHOULD clearly warn about this behavior in documentation.
202 ///
203 /// Support: Extended
204 #[serde(default, skip_serializing_if = "Option::is_none")]
205 pub labels: Option<BTreeMap<String, String>>,
206 /// ParametersRef is a reference to a resource that contains the configuration
207 /// parameters corresponding to the Gateway. This is optional if the
208 /// controller does not require any additional configuration.
209 ///
210 /// This follows the same semantics as GatewayClass's `parametersRef`, but on a per-Gateway basis
211 ///
212 /// The Gateway's GatewayClass may provide its own `parametersRef`. When both are specified,
213 /// the merging behavior is implementation specific.
214 /// It is generally recommended that GatewayClass provides defaults that can be overridden by a Gateway.
215 ///
216 /// Support: Implementation-specific
217 #[serde(
218 default,
219 skip_serializing_if = "Option::is_none",
220 rename = "parametersRef"
221 )]
222 pub parameters_ref: Option<GatewayInfrastructureParametersReference>,
223}
224/// Listener embodies the concept of a logical endpoint where a Gateway accepts
225/// network connections.
226#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
227pub struct GatewayListeners {
228 /// AllowedRoutes defines the types of routes that MAY be attached to a
229 /// Listener and the trusted namespaces where those Route resources MAY be
230 /// present.
231 ///
232 /// Although a client request may match multiple route rules, only one rule
233 /// may ultimately receive the request. Matching precedence MUST be
234 /// determined in order of the following criteria:
235 ///
236 /// * The most specific match as defined by the Route type.
237 /// * The oldest Route based on creation timestamp. For example, a Route with
238 /// a creation timestamp of "2020-09-08 01:02:03" is given precedence over
239 /// a Route with a creation timestamp of "2020-09-08 01:02:04".
240 /// * If everything else is equivalent, the Route appearing first in
241 /// alphabetical order (namespace/name) should be given precedence. For
242 /// example, foo/bar is given precedence over foo/baz.
243 ///
244 /// All valid rules within a Route attached to this Listener should be
245 /// implemented. Invalid Route rules can be ignored (sometimes that will mean
246 /// the full Route). If a Route rule transitions from valid to invalid,
247 /// support for that Route rule should be dropped to ensure consistency. For
248 /// example, even if a filter specified by a Route rule is invalid, the rest
249 /// of the rules within that Route should still be supported.
250 ///
251 /// Support: Core
252 #[serde(
253 default,
254 skip_serializing_if = "Option::is_none",
255 rename = "allowedRoutes"
256 )]
257 pub allowed_routes: Option<GatewayListenersAllowedRoutes>,
258 /// Hostname specifies the virtual hostname to match for protocol types that
259 /// define this concept. When unspecified, all hostnames are matched. This
260 /// field is ignored for protocols that don't require hostname based
261 /// matching.
262 ///
263 /// Implementations MUST apply Hostname matching appropriately for each of
264 /// the following protocols:
265 ///
266 /// * TLS: The Listener Hostname MUST match the SNI.
267 /// * HTTP: The Listener Hostname MUST match the Host header of the request.
268 /// * HTTPS: The Listener Hostname SHOULD match at both the TLS and HTTP
269 /// protocol layers as described above. If an implementation does not
270 /// ensure that both the SNI and Host header match the Listener hostname,
271 /// it MUST clearly document that.
272 ///
273 /// For HTTPRoute and TLSRoute resources, there is an interaction with the
274 /// `spec.hostnames` array. When both listener and route specify hostnames,
275 /// there MUST be an intersection between the values for a Route to be
276 /// accepted. For more information, refer to the Route specific Hostnames
277 /// documentation.
278 ///
279 /// Hostnames that are prefixed with a wildcard label (`*.`) are interpreted
280 /// as a suffix match. That means that a match for `*.example.com` would match
281 /// both `test.example.com`, and `foo.test.example.com`, but not `example.com`.
282 ///
283 /// Support: Core
284 #[serde(default, skip_serializing_if = "Option::is_none")]
285 pub hostname: Option<String>,
286 /// Name is the name of the Listener. This name MUST be unique within a
287 /// Gateway.
288 ///
289 /// Support: Core
290 pub name: String,
291 /// Port is the network port. Multiple listeners may use the
292 /// same port, subject to the Listener compatibility rules.
293 ///
294 /// Support: Core
295 pub port: i32,
296 /// Protocol specifies the network protocol this listener expects to receive.
297 ///
298 /// Support: Core
299 pub protocol: String,
300 /// TLS is the TLS configuration for the Listener. This field is required if
301 /// the Protocol field is "HTTPS" or "TLS". It is invalid to set this field
302 /// if the Protocol field is "HTTP", "TCP", or "UDP".
303 ///
304 /// The association of SNIs to Certificate defined in GatewayTLSConfig is
305 /// defined based on the Hostname field for this listener.
306 ///
307 /// The GatewayClass MUST use the longest matching SNI out of all
308 /// available certificates for any TLS handshake.
309 ///
310 /// Support: Core
311 #[serde(default, skip_serializing_if = "Option::is_none")]
312 pub tls: Option<GatewayListenersTls>,
313}
314/// AllowedRoutes defines the types of routes that MAY be attached to a
315/// Listener and the trusted namespaces where those Route resources MAY be
316/// present.
317///
318/// Although a client request may match multiple route rules, only one rule
319/// may ultimately receive the request. Matching precedence MUST be
320/// determined in order of the following criteria:
321///
322/// * The most specific match as defined by the Route type.
323/// * The oldest Route based on creation timestamp. For example, a Route with
324/// a creation timestamp of "2020-09-08 01:02:03" is given precedence over
325/// a Route with a creation timestamp of "2020-09-08 01:02:04".
326/// * If everything else is equivalent, the Route appearing first in
327/// alphabetical order (namespace/name) should be given precedence. For
328/// example, foo/bar is given precedence over foo/baz.
329///
330/// All valid rules within a Route attached to this Listener should be
331/// implemented. Invalid Route rules can be ignored (sometimes that will mean
332/// the full Route). If a Route rule transitions from valid to invalid,
333/// support for that Route rule should be dropped to ensure consistency. For
334/// example, even if a filter specified by a Route rule is invalid, the rest
335/// of the rules within that Route should still be supported.
336///
337/// Support: Core
338#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
339pub struct GatewayListenersAllowedRoutes {
340 /// Kinds specifies the groups and kinds of Routes that are allowed to bind
341 /// to this Gateway Listener. When unspecified or empty, the kinds of Routes
342 /// selected are determined using the Listener protocol.
343 ///
344 /// A RouteGroupKind MUST correspond to kinds of Routes that are compatible
345 /// with the application protocol specified in the Listener's Protocol field.
346 /// If an implementation does not support or recognize this resource type, it
347 /// MUST set the "ResolvedRefs" condition to False for this Listener with the
348 /// "InvalidRouteKinds" reason.
349 ///
350 /// Support: Core
351 #[serde(default, skip_serializing_if = "Option::is_none")]
352 pub kinds: Option<Vec<Kind>>,
353 /// Namespaces indicates namespaces from which Routes may be attached to this
354 /// Listener. This is restricted to the namespace of this Gateway by default.
355 ///
356 /// Support: Core
357 #[serde(default, skip_serializing_if = "Option::is_none")]
358 pub namespaces: Option<GatewayListenersAllowedRoutesNamespaces>,
359}
360/// Namespaces indicates namespaces from which Routes may be attached to this
361/// Listener. This is restricted to the namespace of this Gateway by default.
362///
363/// Support: Core
364#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
365pub struct GatewayListenersAllowedRoutesNamespaces {
366 /// From indicates where Routes will be selected for this Gateway. Possible
367 /// values are:
368 ///
369 /// * All: Routes in all namespaces may be used by this Gateway.
370 /// * Selector: Routes in namespaces selected by the selector may be used by
371 /// this Gateway.
372 /// * Same: Only Routes in the same namespace may be used by this Gateway.
373 ///
374 /// Support: Core
375 #[serde(default, skip_serializing_if = "Option::is_none")]
376 pub from: Option<GatewayListenersAllowedRoutesNamespacesFrom>,
377 /// Selector must be specified when From is set to "Selector". In that case,
378 /// only Routes in Namespaces matching this Selector will be selected by this
379 /// Gateway. This field is ignored for other values of "From".
380 ///
381 /// Support: Core
382 #[serde(default, skip_serializing_if = "Option::is_none")]
383 pub selector: Option<GatewayListenersAllowedRoutesNamespacesSelector>,
384}
385/// Namespaces indicates namespaces from which Routes may be attached to this
386/// Listener. This is restricted to the namespace of this Gateway by default.
387///
388/// Support: Core
389#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
390pub enum GatewayListenersAllowedRoutesNamespacesFrom {
391 All,
392 Selector,
393 Same,
394}
395/// Selector must be specified when From is set to "Selector". In that case,
396/// only Routes in Namespaces matching this Selector will be selected by this
397/// Gateway. This field is ignored for other values of "From".
398///
399/// Support: Core
400#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
401pub struct GatewayListenersAllowedRoutesNamespacesSelector {
402 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
403 #[serde(
404 default,
405 skip_serializing_if = "Option::is_none",
406 rename = "matchExpressions"
407 )]
408 pub match_expressions:
409 Option<Vec<GatewayListenersAllowedRoutesNamespacesSelectorMatchExpressions>>,
410 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
411 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
412 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
413 #[serde(
414 default,
415 skip_serializing_if = "Option::is_none",
416 rename = "matchLabels"
417 )]
418 pub match_labels: Option<BTreeMap<String, String>>,
419}
420/// A label selector requirement is a selector that contains values, a key, and an operator that
421/// relates the key and values.
422#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
423pub struct GatewayListenersAllowedRoutesNamespacesSelectorMatchExpressions {
424 /// key is the label key that the selector applies to.
425 pub key: String,
426 /// operator represents a key's relationship to a set of values.
427 /// Valid operators are In, NotIn, Exists and DoesNotExist.
428 pub operator: String,
429 /// values is an array of string values. If the operator is In or NotIn,
430 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
431 /// the values array must be empty. This array is replaced during a strategic
432 /// merge patch.
433 #[serde(default, skip_serializing_if = "Option::is_none")]
434 pub values: Option<Vec<String>>,
435}
436/// TLS is the TLS configuration for the Listener. This field is required if
437/// the Protocol field is "HTTPS" or "TLS". It is invalid to set this field
438/// if the Protocol field is "HTTP", "TCP", or "UDP".
439///
440/// The association of SNIs to Certificate defined in GatewayTLSConfig is
441/// defined based on the Hostname field for this listener.
442///
443/// The GatewayClass MUST use the longest matching SNI out of all
444/// available certificates for any TLS handshake.
445///
446/// Support: Core
447#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
448pub struct GatewayListenersTls {
449 /// CertificateRefs contains a series of references to Kubernetes objects that
450 /// contains TLS certificates and private keys. These certificates are used to
451 /// establish a TLS handshake for requests that match the hostname of the
452 /// associated listener.
453 ///
454 /// A single CertificateRef to a Kubernetes Secret has "Core" support.
455 /// Implementations MAY choose to support attaching multiple certificates to
456 /// a Listener, but this behavior is implementation-specific.
457 ///
458 /// References to a resource in different namespace are invalid UNLESS there
459 /// is a ReferenceGrant in the target namespace that allows the certificate
460 /// to be attached. If a ReferenceGrant does not allow this reference, the
461 /// "ResolvedRefs" condition MUST be set to False for this listener with the
462 /// "RefNotPermitted" reason.
463 ///
464 /// This field is required to have at least one element when the mode is set
465 /// to "Terminate" (default) and is optional otherwise.
466 ///
467 /// CertificateRefs can reference to standard Kubernetes resources, i.e.
468 /// Secret, or implementation-specific custom resources.
469 ///
470 /// Support: Core - A single reference to a Kubernetes Secret of type kubernetes.io/tls
471 ///
472 /// Support: Implementation-specific (More than one reference or other resource types)
473 #[serde(
474 default,
475 skip_serializing_if = "Option::is_none",
476 rename = "certificateRefs"
477 )]
478 pub certificate_refs: Option<Vec<GatewayListenersTlsCertificateRefs>>,
479 /// Mode defines the TLS behavior for the TLS session initiated by the client.
480 /// There are two possible modes:
481 ///
482 /// - Terminate: The TLS session between the downstream client and the
483 /// Gateway is terminated at the Gateway. This mode requires certificates
484 /// to be specified in some way, such as populating the certificateRefs
485 /// field.
486 /// - Passthrough: The TLS session is NOT terminated by the Gateway. This
487 /// implies that the Gateway can't decipher the TLS stream except for
488 /// the ClientHello message of the TLS protocol. The certificateRefs field
489 /// is ignored in this mode.
490 ///
491 /// Support: Core
492 #[serde(default, skip_serializing_if = "Option::is_none")]
493 pub mode: Option<GatewayListenersTlsMode>,
494 /// Options are a list of key/value pairs to enable extended TLS
495 /// configuration for each implementation. For example, configuring the
496 /// minimum TLS version or supported cipher suites.
497 ///
498 /// A set of common keys MAY be defined by the API in the future. To avoid
499 /// any ambiguity, implementation-specific definitions MUST use
500 /// domain-prefixed names, such as `example.com/my-custom-option`.
501 /// Un-prefixed names are reserved for key names defined by Gateway API.
502 ///
503 /// Support: Implementation-specific
504 #[serde(default, skip_serializing_if = "Option::is_none")]
505 pub options: Option<BTreeMap<String, String>>,
506}
507/// SecretObjectReference identifies an API object including its namespace,
508/// defaulting to Secret.
509///
510/// The API object must be valid in the cluster; the Group and Kind must
511/// be registered in the cluster for this reference to be valid.
512///
513/// References to objects with invalid Group and Kind are not valid, and must
514/// be rejected by the implementation, with appropriate Conditions set
515/// on the containing object.
516#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
517pub struct GatewayListenersTlsCertificateRefs {
518 /// Group is the group of the referent. For example, "gateway.networking.k8s.io".
519 /// When unspecified or empty string, core API group is inferred.
520 #[serde(default, skip_serializing_if = "Option::is_none")]
521 pub group: Option<String>,
522 /// Kind is kind of the referent. For example "Secret".
523 #[serde(default, skip_serializing_if = "Option::is_none")]
524 pub kind: Option<String>,
525 /// Name is the name of the referent.
526 pub name: String,
527 /// Namespace is the namespace of the referenced object. When unspecified, the local
528 /// namespace is inferred.
529 ///
530 /// Note that when a namespace different than the local namespace is specified,
531 /// a ReferenceGrant object is required in the referent namespace to allow that
532 /// namespace's owner to accept the reference. See the ReferenceGrant
533 /// documentation for details.
534 ///
535 /// Support: Core
536 #[serde(default, skip_serializing_if = "Option::is_none")]
537 pub namespace: Option<String>,
538}
539/// TLS is the TLS configuration for the Listener. This field is required if
540/// the Protocol field is "HTTPS" or "TLS". It is invalid to set this field
541/// if the Protocol field is "HTTP", "TCP", or "UDP".
542///
543/// The association of SNIs to Certificate defined in GatewayTLSConfig is
544/// defined based on the Hostname field for this listener.
545///
546/// The GatewayClass MUST use the longest matching SNI out of all
547/// available certificates for any TLS handshake.
548///
549/// Support: Core
550#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
551pub enum GatewayListenersTlsMode {
552 Terminate,
553 Passthrough,
554}
555/// Status defines the current state of Gateway.
556#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
557pub struct GatewayStatus {
558 /// Addresses lists the network addresses that have been bound to the
559 /// Gateway.
560 ///
561 /// This list may differ from the addresses provided in the spec under some
562 /// conditions:
563 ///
564 /// * no addresses are specified, all addresses are dynamically assigned
565 /// * a combination of specified and dynamic addresses are assigned
566 /// * a specified address was unusable (e.g. already in use)
567 ///
568 ///
569 #[serde(default, skip_serializing_if = "Option::is_none")]
570 pub addresses: Option<Vec<GatewayAddress>>,
571 /// Conditions describe the current conditions of the Gateway.
572 ///
573 /// Implementations should prefer to express Gateway conditions
574 /// using the `GatewayConditionType` and `GatewayConditionReason`
575 /// constants so that operators and tools can converge on a common
576 /// vocabulary to describe Gateway state.
577 ///
578 /// Known condition types are:
579 ///
580 /// * "Accepted"
581 /// * "Programmed"
582 /// * "Ready"
583 #[serde(default, skip_serializing_if = "Option::is_none")]
584 pub conditions: Option<Vec<Condition>>,
585 /// Listeners provide status for each unique listener port defined in the Spec.
586 #[serde(default, skip_serializing_if = "Option::is_none")]
587 pub listeners: Option<Vec<GatewayStatusListeners>>,
588}
589/// ListenerStatus is the status associated with a Listener.
590#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
591pub struct GatewayStatusListeners {
592 /// AttachedRoutes represents the total number of Routes that have been
593 /// successfully attached to this Listener.
594 ///
595 /// Successful attachment of a Route to a Listener is based solely on the
596 /// combination of the AllowedRoutes field on the corresponding Listener
597 /// and the Route's ParentRefs field. A Route is successfully attached to
598 /// a Listener when it is selected by the Listener's AllowedRoutes field
599 /// AND the Route has a valid ParentRef selecting the whole Gateway
600 /// resource or a specific Listener as a parent resource (more detail on
601 /// attachment semantics can be found in the documentation on the various
602 /// Route kinds ParentRefs fields). Listener or Route status does not impact
603 /// successful attachment, i.e. the AttachedRoutes field count MUST be set
604 /// for Listeners with condition Accepted: false and MUST count successfully
605 /// attached Routes that may themselves have Accepted: false conditions.
606 ///
607 /// Uses for this field include troubleshooting Route attachment and
608 /// measuring blast radius/impact of changes to a Listener.
609 #[serde(rename = "attachedRoutes")]
610 pub attached_routes: i32,
611 /// Conditions describe the current condition of this listener.
612 pub conditions: Vec<Condition>,
613 /// Name is the name of the Listener that this status corresponds to.
614 pub name: String,
615 /// SupportedKinds is the list indicating the Kinds supported by this
616 /// listener. This MUST represent the kinds an implementation supports for
617 /// that Listener configuration.
618 ///
619 /// If kinds are specified in Spec that are not supported, they MUST NOT
620 /// appear in this list and an implementation MUST set the "ResolvedRefs"
621 /// condition to "False" with the "InvalidRouteKinds" reason. If both valid
622 /// and invalid Route kinds are specified, the implementation MUST
623 /// reference the valid Route kinds that have been specified.
624 #[serde(rename = "supportedKinds")]
625 pub supported_kinds: Vec<Kind>,
626}