Skip to main content

gateway_api/apis/experimental/
grpcroutes.rs

1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium --schema=derived --derive=JsonSchema --derive=Default --derive=PartialEq --docs -f -
3// kopium version: 0.22.5
4
5#[allow(unused_imports)]
6mod prelude {
7    pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
8    pub use kube::CustomResource;
9    pub use schemars::JsonSchema;
10    pub use serde::{Deserialize, Serialize};
11}
12use self::prelude::*;
13
14/// Spec defines the desired state of GRPCRoute.
15#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
16#[kube(
17    group = "gateway.networking.k8s.io",
18    version = "v1",
19    kind = "GRPCRoute",
20    plural = "grpcroutes"
21)]
22#[kube(namespaced)]
23#[kube(status = "GrpcRouteStatus")]
24#[kube(derive = "Default")]
25#[kube(derive = "PartialEq")]
26pub struct GrpcRouteSpec {
27    /// Hostnames defines a set of hostnames to match against the GRPC
28    /// Host header to select a GRPCRoute to process the request. This matches
29    /// the RFC 1123 definition of a hostname with 2 notable exceptions:
30    ///
31    /// 1. IPs are not allowed.
32    /// 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard
33    ///    label MUST appear by itself as the first label.
34    ///
35    /// If a hostname is specified by both the Listener and GRPCRoute, there
36    /// MUST be at least one intersecting hostname for the GRPCRoute to be
37    /// attached to the Listener. For example:
38    ///
39    /// * A Listener with `test.example.com` as the hostname matches GRPCRoutes
40    ///   that have either not specified any hostnames, or have specified at
41    ///   least one of `test.example.com` or `*.example.com`.
42    /// * A Listener with `*.example.com` as the hostname matches GRPCRoutes
43    ///   that have either not specified any hostnames or have specified at least
44    ///   one hostname that matches the Listener hostname. For example,
45    ///   `test.example.com` and `*.example.com` would both match. On the other
46    ///   hand, `example.com` and `test.example.net` would not match.
47    ///
48    /// Hostnames that are prefixed with a wildcard label (`*.`) are interpreted
49    /// as a suffix match. That means that a match for `*.example.com` would match
50    /// both `test.example.com`, and `foo.test.example.com`, but not `example.com`.
51    ///
52    /// If both the Listener and GRPCRoute have specified hostnames, any
53    /// GRPCRoute hostnames that do not match the Listener hostname MUST be
54    /// ignored. For example, if a Listener specified `*.example.com`, and the
55    /// GRPCRoute specified `test.example.com` and `test.example.net`,
56    /// `test.example.net` MUST NOT be considered for a match.
57    ///
58    /// If both the Listener and GRPCRoute have specified hostnames, and none
59    /// match with the criteria above, then the GRPCRoute MUST NOT be accepted by
60    /// the implementation. The implementation MUST raise an 'Accepted' Condition
61    /// with a status of `False` in the corresponding RouteParentStatus.
62    ///
63    /// If a Route (A) of type HTTPRoute or GRPCRoute is attached to a
64    /// Listener and that listener already has another Route (B) of the other
65    /// type attached and the intersection of the hostnames of A and B is
66    /// non-empty, then the implementation MUST accept exactly one of these two
67    /// routes, determined by the following criteria, in order:
68    ///
69    /// * The oldest Route based on creation timestamp.
70    /// * The Route appearing first in alphabetical order by
71    ///   "{namespace}/{name}".
72    ///
73    /// The rejected Route MUST raise an 'Accepted' condition with a status of
74    /// 'False' in the corresponding RouteParentStatus.
75    ///
76    /// Support: Core
77    #[serde(default, skip_serializing_if = "Option::is_none")]
78    pub hostnames: Option<Vec<String>>,
79    /// ParentRefs references the resources (usually Gateways) that a Route wants
80    /// to be attached to. Note that the referenced parent resource needs to
81    /// allow this for the attachment to be complete. For Gateways, that means
82    /// the Gateway needs to allow attachment from Routes of this kind and
83    /// namespace. For Services, that means the Service must either be in the same
84    /// namespace for a "producer" route, or the mesh implementation must support
85    /// and allow "consumer" routes for the referenced Service. ReferenceGrant is
86    /// not applicable for governing ParentRefs to Services - it is not possible to
87    /// create a "producer" route for a Service in a different namespace from the
88    /// Route.
89    ///
90    /// There are two kinds of parent resources with "Core" support:
91    ///
92    /// * Gateway (Gateway conformance profile)
93    /// * Service (Mesh conformance profile, ClusterIP Services only)
94    ///
95    /// This API may be extended in the future to support additional kinds of parent
96    /// resources.
97    ///
98    /// ParentRefs must be _distinct_. This means either that:
99    ///
100    /// * They select different objects.  If this is the case, then parentRef
101    ///   entries are distinct. In terms of fields, this means that the
102    ///   multi-part key defined by `group`, `kind`, `namespace`, and `name` must
103    ///   be unique across all parentRef entries in the Route.
104    /// * They do not select different objects, but for each optional field used,
105    ///   each ParentRef that selects the same object must set the same set of
106    ///   optional fields to different values. If one ParentRef sets a
107    ///   combination of optional fields, all must set the same combination.
108    ///
109    /// Some examples:
110    ///
111    /// * If one ParentRef sets `sectionName`, all ParentRefs referencing the
112    ///   same object must also set `sectionName`.
113    /// * If one ParentRef sets `port`, all ParentRefs referencing the same
114    ///   object must also set `port`.
115    /// * If one ParentRef sets `sectionName` and `port`, all ParentRefs
116    ///   referencing the same object must also set `sectionName` and `port`.
117    ///
118    /// It is possible to separately reference multiple distinct objects that may
119    /// be collapsed by an implementation. For example, some implementations may
120    /// choose to merge compatible Gateway Listeners together. If that is the
121    /// case, the list of routes attached to those resources should also be
122    /// merged.
123    ///
124    /// Note that for ParentRefs that cross namespace boundaries, there are specific
125    /// rules. Cross-namespace references are only valid if they are explicitly
126    /// allowed by something in the namespace they are referring to. For example,
127    /// Gateway has the AllowedRoutes field, and ReferenceGrant provides a
128    /// generic way to enable other kinds of cross-namespace reference.
129    ///
130    ///
131    /// ParentRefs from a Route to a Service in the same namespace are "producer"
132    /// routes, which apply default routing rules to inbound connections from
133    /// any namespace to the Service.
134    ///
135    /// ParentRefs from a Route to a Service in a different namespace are
136    /// "consumer" routes, and these routing rules are only applied to outbound
137    /// connections originating from the same namespace as the Route, for which
138    /// the intended destination of the connections are a Service targeted as a
139    /// ParentRef of the Route.
140    #[serde(default, skip_serializing_if = "Option::is_none", rename = "parentRefs")]
141    pub parent_refs: Option<Vec<GrpcRouteParentRefs>>,
142    /// Rules are a list of GRPC matchers, filters and actions.
143    #[serde(default, skip_serializing_if = "Option::is_none")]
144    pub rules: Option<Vec<GrpcRouteRules>>,
145    /// UseDefaultGateways indicates the default Gateway scope to use for this
146    /// Route. If unset (the default) or set to None, the Route will not be
147    /// attached to any default Gateway; if set, it will be attached to any
148    /// default Gateway supporting the named scope, subject to the usual rules
149    /// about which Routes a Gateway is allowed to claim.
150    ///
151    /// Think carefully before using this functionality! The set of default
152    /// Gateways supporting the requested scope can change over time without
153    /// any notice to the Route author, and in many situations it will not be
154    /// appropriate to request a default Gateway for a given Route -- for
155    /// example, a Route with specific security requirements should almost
156    /// certainly not use a default Gateway.
157    #[serde(default, skip_serializing_if = "Option::is_none", rename = "useDefaultGateways")]
158    pub use_default_gateways: Option<GrpcRouteUseDefaultGateways>,
159}
160
161/// ParentReference identifies an API object (usually a Gateway) that can be considered
162/// a parent of this resource (usually a route). There are two kinds of parent resources
163/// with "Core" support:
164///
165/// * Gateway (Gateway conformance profile)
166/// * Service (Mesh conformance profile, ClusterIP Services only)
167///
168/// This API may be extended in the future to support additional kinds of parent
169/// resources.
170///
171/// The API object must be valid in the cluster; the Group and Kind must
172/// be registered in the cluster for this reference to be valid.
173#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
174pub struct GrpcRouteParentRefs {
175    /// Group is the group of the referent.
176    /// When unspecified, "gateway.networking.k8s.io" is inferred.
177    /// To set the core API group (such as for a "Service" kind referent),
178    /// Group must be explicitly set to "" (empty string).
179    ///
180    /// Support: Core
181    #[serde(default, skip_serializing_if = "Option::is_none")]
182    pub group: Option<String>,
183    /// Kind is kind of the referent.
184    ///
185    /// There are two kinds of parent resources with "Core" support:
186    ///
187    /// * Gateway (Gateway conformance profile)
188    /// * Service (Mesh conformance profile, ClusterIP Services only)
189    ///
190    /// Support for other resources is Implementation-Specific.
191    #[serde(default, skip_serializing_if = "Option::is_none")]
192    pub kind: Option<String>,
193    /// Name is the name of the referent.
194    ///
195    /// Support: Core
196    pub name: String,
197    /// Namespace is the namespace of the referent. When unspecified, this refers
198    /// to the local namespace of the Route.
199    ///
200    /// Note that there are specific rules for ParentRefs which cross namespace
201    /// boundaries. Cross-namespace references are only valid if they are explicitly
202    /// allowed by something in the namespace they are referring to. For example:
203    /// Gateway has the AllowedRoutes field, and ReferenceGrant provides a
204    /// generic way to enable any other kind of cross-namespace reference.
205    ///
206    ///
207    /// ParentRefs from a Route to a Service in the same namespace are "producer"
208    /// routes, which apply default routing rules to inbound connections from
209    /// any namespace to the Service.
210    ///
211    /// ParentRefs from a Route to a Service in a different namespace are
212    /// "consumer" routes, and these routing rules are only applied to outbound
213    /// connections originating from the same namespace as the Route, for which
214    /// the intended destination of the connections are a Service targeted as a
215    /// ParentRef of the Route.
216    ///
217    ///
218    /// Support: Core
219    #[serde(default, skip_serializing_if = "Option::is_none")]
220    pub namespace: Option<String>,
221    /// Port is the network port this Route targets. It can be interpreted
222    /// differently based on the type of parent resource.
223    ///
224    /// When the parent resource is a Gateway, this targets all listeners
225    /// listening on the specified port that also support this kind of Route(and
226    /// select this Route). It's not recommended to set `Port` unless the
227    /// networking behaviors specified in a Route must apply to a specific port
228    /// as opposed to a listener(s) whose port(s) may be changed. When both Port
229    /// and SectionName are specified, the name and port of the selected listener
230    /// must match both specified values.
231    ///
232    ///
233    /// When the parent resource is a Service, this targets a specific port in the
234    /// Service spec. When both Port (experimental) and SectionName are specified,
235    /// the name and port of the selected port must match both specified values.
236    ///
237    ///
238    /// Implementations MAY choose to support other parent resources.
239    /// Implementations supporting other types of parent resources MUST clearly
240    /// document how/if Port is interpreted.
241    ///
242    /// For the purpose of status, an attachment is considered successful as
243    /// long as the parent resource accepts it partially. For example, Gateway
244    /// listeners can restrict which Routes can attach to them by Route kind,
245    /// namespace, or hostname. If 1 of 2 Gateway listeners accept attachment
246    /// from the referencing Route, the Route MUST be considered successfully
247    /// attached. If no Gateway listeners accept attachment from this Route,
248    /// the Route MUST be considered detached from the Gateway.
249    ///
250    /// Support: Extended
251    #[serde(default, skip_serializing_if = "Option::is_none")]
252    pub port: Option<i32>,
253    /// SectionName is the name of a section within the target resource. In the
254    /// following resources, SectionName is interpreted as the following:
255    ///
256    /// * Gateway: Listener name. When both Port (experimental) and SectionName
257    /// are specified, the name and port of the selected listener must match
258    /// both specified values.
259    /// * Service: Port name. When both Port (experimental) and SectionName
260    /// are specified, the name and port of the selected listener must match
261    /// both specified values.
262    ///
263    /// Implementations MAY choose to support attaching Routes to other resources.
264    /// If that is the case, they MUST clearly document how SectionName is
265    /// interpreted.
266    ///
267    /// When unspecified (empty string), this will reference the entire resource.
268    /// For the purpose of status, an attachment is considered successful if at
269    /// least one section in the parent resource accepts it. For example, Gateway
270    /// listeners can restrict which Routes can attach to them by Route kind,
271    /// namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from
272    /// the referencing Route, the Route MUST be considered successfully
273    /// attached. If no Gateway listeners accept attachment from this Route, the
274    /// Route MUST be considered detached from the Gateway.
275    ///
276    /// Support: Core
277    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sectionName")]
278    pub section_name: Option<String>,
279}
280
281/// GRPCRouteRule defines the semantics for matching a gRPC request based on
282/// conditions (matches), processing it (filters), and forwarding the request to
283/// an API object (backendRefs).
284#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
285pub struct GrpcRouteRules {
286    /// BackendRefs defines the backend(s) where matching requests should be
287    /// sent.
288    ///
289    /// Failure behavior here depends on how many BackendRefs are specified and
290    /// how many are invalid.
291    ///
292    /// If *all* entries in BackendRefs are invalid, and there are also no filters
293    /// specified in this route rule, *all* traffic which matches this rule MUST
294    /// receive an `UNAVAILABLE` status.
295    ///
296    /// See the GRPCBackendRef definition for the rules about what makes a single
297    /// GRPCBackendRef invalid.
298    ///
299    /// When a GRPCBackendRef is invalid, `UNAVAILABLE` statuses MUST be returned for
300    /// requests that would have otherwise been routed to an invalid backend. If
301    /// multiple backends are specified, and some are invalid, the proportion of
302    /// requests that would otherwise have been routed to an invalid backend
303    /// MUST receive an `UNAVAILABLE` status.
304    ///
305    /// For example, if two backends are specified with equal weights, and one is
306    /// invalid, 50 percent of traffic MUST receive an `UNAVAILABLE` status.
307    /// Implementations may choose how that 50 percent is determined.
308    ///
309    /// Support: Core for Kubernetes Service
310    ///
311    /// Support: Implementation-specific for any other resource
312    ///
313    /// Support for weight: Core
314    #[serde(default, skip_serializing_if = "Option::is_none", rename = "backendRefs")]
315    pub backend_refs: Option<Vec<GrpcRouteRulesBackendRefs>>,
316    /// Filters define the filters that are applied to requests that match
317    /// this rule.
318    ///
319    /// The effects of ordering of multiple behaviors are currently unspecified.
320    /// This can change in the future based on feedback during the alpha stage.
321    ///
322    /// Conformance-levels at this level are defined based on the type of filter:
323    ///
324    /// - ALL core filters MUST be supported by all implementations that support
325    ///   GRPCRoute.
326    /// - Implementers are encouraged to support extended filters.
327    /// - Implementation-specific custom filters have no API guarantees across
328    ///   implementations.
329    ///
330    /// Specifying the same filter multiple times is not supported unless explicitly
331    /// indicated in the filter.
332    ///
333    /// If an implementation cannot support a combination of filters, it must clearly
334    /// document that limitation. In cases where incompatible or unsupported
335    /// filters are specified and cause the `Accepted` condition to be set to status
336    /// `False`, implementations may use the `IncompatibleFilters` reason to specify
337    /// this configuration error.
338    ///
339    /// Support: Core
340    #[serde(default, skip_serializing_if = "Option::is_none")]
341    pub filters: Option<Vec<GrpcRouteRulesFilters>>,
342    /// Matches define conditions used for matching the rule against incoming
343    /// gRPC requests. Each match is independent, i.e. this rule will be matched
344    /// if **any** one of the matches is satisfied.
345    ///
346    /// For example, take the following matches configuration:
347    ///
348    /// ```text
349    /// matches:
350    /// - method:
351    ///     service: foo.bar
352    ///   headers:
353    ///     values:
354    ///       version: 2
355    /// - method:
356    ///     service: foo.bar.v2
357    /// ```
358    ///
359    /// For a request to match against this rule, it MUST satisfy
360    /// EITHER of the two conditions:
361    ///
362    /// - service of foo.bar AND contains the header `version: 2`
363    /// - service of foo.bar.v2
364    ///
365    /// See the documentation for GRPCRouteMatch on how to specify multiple
366    /// match conditions to be ANDed together.
367    ///
368    /// If no matches are specified, the implementation MUST match every gRPC request.
369    ///
370    /// Proxy or Load Balancer routing configuration generated from GRPCRoutes
371    /// MUST prioritize rules based on the following criteria, continuing on
372    /// ties. Merging MUST not be done between GRPCRoutes and HTTPRoutes.
373    /// Precedence MUST be given to the rule with the largest number of:
374    ///
375    /// * Characters in a matching non-wildcard hostname.
376    /// * Characters in a matching hostname.
377    /// * Characters in a matching service.
378    /// * Characters in a matching method.
379    /// * Header matches.
380    ///
381    /// If ties still exist across multiple Routes, matching precedence MUST be
382    /// determined in order of the following criteria, continuing on ties:
383    ///
384    /// * The oldest Route based on creation timestamp.
385    /// * The Route appearing first in alphabetical order by
386    ///   "{namespace}/{name}".
387    ///
388    /// If ties still exist within the Route that has been given precedence,
389    /// matching precedence MUST be granted to the first matching rule meeting
390    /// the above criteria.
391    #[serde(default, skip_serializing_if = "Option::is_none")]
392    pub matches: Option<Vec<GrpcRouteRulesMatches>>,
393    /// Name is the name of the route rule. This name MUST be unique within a Route if it is set.
394    ///
395    /// Support: Extended
396    #[serde(default, skip_serializing_if = "Option::is_none")]
397    pub name: Option<String>,
398    /// SessionPersistence defines and configures session persistence
399    /// for the route rule.
400    ///
401    /// Support: Extended
402    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sessionPersistence")]
403    pub session_persistence: Option<GrpcRouteRulesSessionPersistence>,
404}
405
406/// GRPCBackendRef defines how a GRPCRoute forwards a gRPC request.
407///
408/// Note that when a namespace different than the local namespace is specified, a
409/// ReferenceGrant object is required in the referent namespace to allow that
410/// namespace's owner to accept the reference. See the ReferenceGrant
411/// documentation for details.
412///
413///
414/// When the BackendRef points to a Kubernetes Service, implementations SHOULD
415/// honor the appProtocol field if it is set for the target Service Port.
416///
417/// Implementations supporting appProtocol SHOULD recognize the Kubernetes
418/// Standard Application Protocols defined in KEP-3726.
419///
420/// If a Service appProtocol isn't specified, an implementation MAY infer the
421/// backend protocol through its own means. Implementations MAY infer the
422/// protocol from the Route type referring to the backend Service.
423///
424/// If a Route is not able to send traffic to the backend using the specified
425/// protocol then the backend is considered invalid. Implementations MUST set the
426/// "ResolvedRefs" condition to "False" with the "UnsupportedProtocol" reason.
427#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
428pub struct GrpcRouteRulesBackendRefs {
429    /// Filters defined at this level MUST be executed if and only if the
430    /// request is being forwarded to the backend defined here.
431    ///
432    /// Support: Implementation-specific (For broader support of filters, use the
433    /// Filters field in GRPCRouteRule.)
434    #[serde(default, skip_serializing_if = "Option::is_none")]
435    pub filters: Option<Vec<GrpcRouteRulesBackendRefsFilters>>,
436    /// Group is the group of the referent. For example, "gateway.networking.k8s.io".
437    /// When unspecified or empty string, core API group is inferred.
438    #[serde(default, skip_serializing_if = "Option::is_none")]
439    pub group: Option<String>,
440    /// Kind is the Kubernetes resource kind of the referent. For example
441    /// "Service".
442    ///
443    /// Defaults to "Service" when not specified.
444    ///
445    /// ExternalName services can refer to CNAME DNS records that may live
446    /// outside of the cluster and as such are difficult to reason about in
447    /// terms of conformance. They also may not be safe to forward to (see
448    /// CVE-2021-25740 for more information). Implementations SHOULD NOT
449    /// support ExternalName Services.
450    ///
451    /// Support: Core (Services with a type other than ExternalName)
452    ///
453    /// Support: Implementation-specific (Services with type ExternalName)
454    #[serde(default, skip_serializing_if = "Option::is_none")]
455    pub kind: Option<String>,
456    /// Name is the name of the referent.
457    pub name: String,
458    /// Namespace is the namespace of the backend. When unspecified, the local
459    /// namespace is inferred.
460    ///
461    /// Note that when a namespace different than the local namespace is specified,
462    /// a ReferenceGrant object is required in the referent namespace to allow that
463    /// namespace's owner to accept the reference. See the ReferenceGrant
464    /// documentation for details.
465    ///
466    /// Support: Core
467    #[serde(default, skip_serializing_if = "Option::is_none")]
468    pub namespace: Option<String>,
469    /// Port specifies the destination port number to use for this resource.
470    /// Port is required when the referent is a Kubernetes Service. In this
471    /// case, the port number is the service port number, not the target port.
472    /// For other resources, destination port might be derived from the referent
473    /// resource or this field.
474    #[serde(default, skip_serializing_if = "Option::is_none")]
475    pub port: Option<i32>,
476    /// Weight specifies the proportion of requests forwarded to the referenced
477    /// backend. This is computed as weight/(sum of all weights in this
478    /// BackendRefs list). For non-zero values, there may be some epsilon from
479    /// the exact proportion defined here depending on the precision an
480    /// implementation supports. Weight is not a percentage and the sum of
481    /// weights does not need to equal 100.
482    ///
483    /// If only one backend is specified and it has a weight greater than 0, 100%
484    /// of the traffic is forwarded to that backend. If weight is set to 0, no
485    /// traffic should be forwarded for this entry. If unspecified, weight
486    /// defaults to 1.
487    ///
488    /// Support for this field varies based on the context where used.
489    #[serde(default, skip_serializing_if = "Option::is_none")]
490    pub weight: Option<i32>,
491}
492
493/// GRPCRouteFilter defines processing steps that must be completed during the
494/// request or response lifecycle. GRPCRouteFilters are meant as an extension
495/// point to express processing that may be done in Gateway implementations. Some
496/// examples include request or response modification, implementing
497/// authentication strategies, rate-limiting, and traffic shaping. API
498/// guarantee/conformance is defined based on the type of the filter.
499#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
500pub struct GrpcRouteRulesBackendRefsFilters {
501    /// ExtensionRef is an optional, implementation-specific extension to the
502    /// "filter" behavior.  For example, resource "myroutefilter" in group
503    /// "networking.example.net"). ExtensionRef MUST NOT be used for core and
504    /// extended filters.
505    ///
506    /// Support: Implementation-specific
507    ///
508    /// This filter can be used multiple times within the same rule.
509    #[serde(default, skip_serializing_if = "Option::is_none", rename = "extensionRef")]
510    pub extension_ref: Option<GrpcRouteRulesBackendRefsFiltersExtensionRef>,
511    /// RequestHeaderModifier defines a schema for a filter that modifies request
512    /// headers.
513    ///
514    /// Support: Core
515    #[serde(default, skip_serializing_if = "Option::is_none", rename = "requestHeaderModifier")]
516    pub request_header_modifier: Option<GrpcRouteRulesBackendRefsFiltersRequestHeaderModifier>,
517    /// RequestMirror defines a schema for a filter that mirrors requests.
518    /// Requests are sent to the specified destination, but responses from
519    /// that destination are ignored.
520    ///
521    /// This filter can be used multiple times within the same rule. Note that
522    /// not all implementations will be able to support mirroring to multiple
523    /// backends.
524    ///
525    /// Support: Extended
526    #[serde(default, skip_serializing_if = "Option::is_none", rename = "requestMirror")]
527    pub request_mirror: Option<GrpcRouteRulesBackendRefsFiltersRequestMirror>,
528    /// ResponseHeaderModifier defines a schema for a filter that modifies response
529    /// headers.
530    ///
531    /// Support: Extended
532    #[serde(default, skip_serializing_if = "Option::is_none", rename = "responseHeaderModifier")]
533    pub response_header_modifier: Option<GrpcRouteRulesBackendRefsFiltersResponseHeaderModifier>,
534    /// Type identifies the type of filter to apply. As with other API fields,
535    /// types are classified into three conformance levels:
536    ///
537    /// - Core: Filter types and their corresponding configuration defined by
538    ///   "Support: Core" in this package, e.g. "RequestHeaderModifier". All
539    ///   implementations supporting GRPCRoute MUST support core filters.
540    ///
541    /// - Extended: Filter types and their corresponding configuration defined by
542    ///   "Support: Extended" in this package, e.g. "RequestMirror". Implementers
543    ///   are encouraged to support extended filters.
544    ///
545    /// - Implementation-specific: Filters that are defined and supported by specific vendors.
546    ///   In the future, filters showing convergence in behavior across multiple
547    ///   implementations will be considered for inclusion in extended or core
548    ///   conformance levels. Filter-specific configuration for such filters
549    ///   is specified using the ExtensionRef field. `Type` MUST be set to
550    ///   "ExtensionRef" for custom filters.
551    ///
552    /// Implementers are encouraged to define custom implementation types to
553    /// extend the core API with implementation-specific behavior.
554    ///
555    /// If a reference to a custom filter type cannot be resolved, the filter
556    /// MUST NOT be skipped. Instead, requests that would have been processed by
557    /// that filter MUST receive a HTTP error response.
558    #[serde(rename = "type")]
559    pub r#type: GrpcRouteRulesBackendRefsFiltersType,
560}
561
562/// ExtensionRef is an optional, implementation-specific extension to the
563/// "filter" behavior.  For example, resource "myroutefilter" in group
564/// "networking.example.net"). ExtensionRef MUST NOT be used for core and
565/// extended filters.
566///
567/// Support: Implementation-specific
568///
569/// This filter can be used multiple times within the same rule.
570#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
571pub struct GrpcRouteRulesBackendRefsFiltersExtensionRef {
572    /// Group is the group of the referent. For example, "gateway.networking.k8s.io".
573    /// When unspecified or empty string, core API group is inferred.
574    pub group: String,
575    /// Kind is kind of the referent. For example "HTTPRoute" or "Service".
576    pub kind: String,
577    /// Name is the name of the referent.
578    pub name: String,
579}
580
581/// RequestHeaderModifier defines a schema for a filter that modifies request
582/// headers.
583///
584/// Support: Core
585#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
586pub struct GrpcRouteRulesBackendRefsFiltersRequestHeaderModifier {
587    /// Add adds the given header(s) (name, value) to the request
588    /// before the action. It appends to any existing values associated
589    /// with the header name.
590    ///
591    /// Input:
592    ///   GET /foo HTTP/1.1
593    ///   my-header: foo
594    ///
595    /// Config:
596    ///   add:
597    ///   - name: "my-header"
598    ///     value: "bar,baz"
599    ///
600    /// Output:
601    ///   GET /foo HTTP/1.1
602    ///   my-header: foo,bar,baz
603    #[serde(default, skip_serializing_if = "Option::is_none")]
604    pub add: Option<Vec<GrpcRouteRulesBackendRefsFiltersRequestHeaderModifierAdd>>,
605    /// Remove the given header(s) from the HTTP request before the action. The
606    /// value of Remove is a list of HTTP header names. Note that the header
607    /// names are case-insensitive (see
608    /// <https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).>
609    ///
610    /// Input:
611    ///   GET /foo HTTP/1.1
612    ///   my-header1: foo
613    ///   my-header2: bar
614    ///   my-header3: baz
615    ///
616    /// Config:
617    ///   remove: ["my-header1", "my-header3"]
618    ///
619    /// Output:
620    ///   GET /foo HTTP/1.1
621    ///   my-header2: bar
622    #[serde(default, skip_serializing_if = "Option::is_none")]
623    pub remove: Option<Vec<String>>,
624    /// Set overwrites the request with the given header (name, value)
625    /// before the action.
626    ///
627    /// Input:
628    ///   GET /foo HTTP/1.1
629    ///   my-header: foo
630    ///
631    /// Config:
632    ///   set:
633    ///   - name: "my-header"
634    ///     value: "bar"
635    ///
636    /// Output:
637    ///   GET /foo HTTP/1.1
638    ///   my-header: bar
639    #[serde(default, skip_serializing_if = "Option::is_none")]
640    pub set: Option<Vec<GrpcRouteRulesBackendRefsFiltersRequestHeaderModifierSet>>,
641}
642
643/// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
644#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
645pub struct GrpcRouteRulesBackendRefsFiltersRequestHeaderModifierAdd {
646    /// Name is the name of the HTTP Header to be matched. Name matching MUST be
647    /// case-insensitive. (See <https://tools.ietf.org/html/rfc7230#section-3.2).>
648    ///
649    /// If multiple entries specify equivalent header names, the first entry with
650    /// an equivalent name MUST be considered for a match. Subsequent entries
651    /// with an equivalent header name MUST be ignored. Due to the
652    /// case-insensitivity of header names, "foo" and "Foo" are considered
653    /// equivalent.
654    pub name: String,
655    /// Value is the value of HTTP Header to be matched.
656    ///
657    /// Must consist of printable US-ASCII characters, optionally separated
658    /// by single tabs or spaces. See: <https://tools.ietf.org/html/rfc7230#section-3.2>
659    pub value: String,
660}
661
662/// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
663#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
664pub struct GrpcRouteRulesBackendRefsFiltersRequestHeaderModifierSet {
665    /// Name is the name of the HTTP Header to be matched. Name matching MUST be
666    /// case-insensitive. (See <https://tools.ietf.org/html/rfc7230#section-3.2).>
667    ///
668    /// If multiple entries specify equivalent header names, the first entry with
669    /// an equivalent name MUST be considered for a match. Subsequent entries
670    /// with an equivalent header name MUST be ignored. Due to the
671    /// case-insensitivity of header names, "foo" and "Foo" are considered
672    /// equivalent.
673    pub name: String,
674    /// Value is the value of HTTP Header to be matched.
675    ///
676    /// Must consist of printable US-ASCII characters, optionally separated
677    /// by single tabs or spaces. See: <https://tools.ietf.org/html/rfc7230#section-3.2>
678    pub value: String,
679}
680
681/// RequestMirror defines a schema for a filter that mirrors requests.
682/// Requests are sent to the specified destination, but responses from
683/// that destination are ignored.
684///
685/// This filter can be used multiple times within the same rule. Note that
686/// not all implementations will be able to support mirroring to multiple
687/// backends.
688///
689/// Support: Extended
690#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
691pub struct GrpcRouteRulesBackendRefsFiltersRequestMirror {
692    /// BackendRef references a resource where mirrored requests are sent.
693    ///
694    /// Mirrored requests must be sent only to a single destination endpoint
695    /// within this BackendRef, irrespective of how many endpoints are present
696    /// within this BackendRef.
697    ///
698    /// If the referent cannot be found, this BackendRef is invalid and must be
699    /// dropped from the Gateway. The controller must ensure the "ResolvedRefs"
700    /// condition on the Route status is set to `status: False` and not configure
701    /// this backend in the underlying implementation.
702    ///
703    /// If there is a cross-namespace reference to an *existing* object
704    /// that is not allowed by a ReferenceGrant, the controller must ensure the
705    /// "ResolvedRefs"  condition on the Route is set to `status: False`,
706    /// with the "RefNotPermitted" reason and not configure this backend in the
707    /// underlying implementation.
708    ///
709    /// In either error case, the Message of the `ResolvedRefs` Condition
710    /// should be used to provide more detail about the problem.
711    ///
712    /// Support: Extended for Kubernetes Service
713    ///
714    /// Support: Implementation-specific for any other resource
715    #[serde(rename = "backendRef")]
716    pub backend_ref: GrpcRouteRulesBackendRefsFiltersRequestMirrorBackendRef,
717    /// Fraction represents the fraction of requests that should be
718    /// mirrored to BackendRef.
719    ///
720    /// Only one of Fraction or Percent may be specified. If neither field
721    /// is specified, 100% of requests will be mirrored.
722    #[serde(default, skip_serializing_if = "Option::is_none")]
723    pub fraction: Option<GrpcRouteRulesBackendRefsFiltersRequestMirrorFraction>,
724    /// Percent represents the percentage of requests that should be
725    /// mirrored to BackendRef. Its minimum value is 0 (indicating 0% of
726    /// requests) and its maximum value is 100 (indicating 100% of requests).
727    ///
728    /// Only one of Fraction or Percent may be specified. If neither field
729    /// is specified, 100% of requests will be mirrored.
730    #[serde(default, skip_serializing_if = "Option::is_none")]
731    pub percent: Option<i32>,
732}
733
734/// BackendRef references a resource where mirrored requests are sent.
735///
736/// Mirrored requests must be sent only to a single destination endpoint
737/// within this BackendRef, irrespective of how many endpoints are present
738/// within this BackendRef.
739///
740/// If the referent cannot be found, this BackendRef is invalid and must be
741/// dropped from the Gateway. The controller must ensure the "ResolvedRefs"
742/// condition on the Route status is set to `status: False` and not configure
743/// this backend in the underlying implementation.
744///
745/// If there is a cross-namespace reference to an *existing* object
746/// that is not allowed by a ReferenceGrant, the controller must ensure the
747/// "ResolvedRefs"  condition on the Route is set to `status: False`,
748/// with the "RefNotPermitted" reason and not configure this backend in the
749/// underlying implementation.
750///
751/// In either error case, the Message of the `ResolvedRefs` Condition
752/// should be used to provide more detail about the problem.
753///
754/// Support: Extended for Kubernetes Service
755///
756/// Support: Implementation-specific for any other resource
757#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
758pub struct GrpcRouteRulesBackendRefsFiltersRequestMirrorBackendRef {
759    /// Group is the group of the referent. For example, "gateway.networking.k8s.io".
760    /// When unspecified or empty string, core API group is inferred.
761    #[serde(default, skip_serializing_if = "Option::is_none")]
762    pub group: Option<String>,
763    /// Kind is the Kubernetes resource kind of the referent. For example
764    /// "Service".
765    ///
766    /// Defaults to "Service" when not specified.
767    ///
768    /// ExternalName services can refer to CNAME DNS records that may live
769    /// outside of the cluster and as such are difficult to reason about in
770    /// terms of conformance. They also may not be safe to forward to (see
771    /// CVE-2021-25740 for more information). Implementations SHOULD NOT
772    /// support ExternalName Services.
773    ///
774    /// Support: Core (Services with a type other than ExternalName)
775    ///
776    /// Support: Implementation-specific (Services with type ExternalName)
777    #[serde(default, skip_serializing_if = "Option::is_none")]
778    pub kind: Option<String>,
779    /// Name is the name of the referent.
780    pub name: String,
781    /// Namespace is the namespace of the backend. When unspecified, the local
782    /// namespace is inferred.
783    ///
784    /// Note that when a namespace different than the local namespace is specified,
785    /// a ReferenceGrant object is required in the referent namespace to allow that
786    /// namespace's owner to accept the reference. See the ReferenceGrant
787    /// documentation for details.
788    ///
789    /// Support: Core
790    #[serde(default, skip_serializing_if = "Option::is_none")]
791    pub namespace: Option<String>,
792    /// Port specifies the destination port number to use for this resource.
793    /// Port is required when the referent is a Kubernetes Service. In this
794    /// case, the port number is the service port number, not the target port.
795    /// For other resources, destination port might be derived from the referent
796    /// resource or this field.
797    #[serde(default, skip_serializing_if = "Option::is_none")]
798    pub port: Option<i32>,
799}
800
801/// Fraction represents the fraction of requests that should be
802/// mirrored to BackendRef.
803///
804/// Only one of Fraction or Percent may be specified. If neither field
805/// is specified, 100% of requests will be mirrored.
806#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
807pub struct GrpcRouteRulesBackendRefsFiltersRequestMirrorFraction {
808    #[serde(default, skip_serializing_if = "Option::is_none")]
809    pub denominator: Option<i32>,
810    pub numerator: i32,
811}
812
813/// ResponseHeaderModifier defines a schema for a filter that modifies response
814/// headers.
815///
816/// Support: Extended
817#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
818pub struct GrpcRouteRulesBackendRefsFiltersResponseHeaderModifier {
819    /// Add adds the given header(s) (name, value) to the request
820    /// before the action. It appends to any existing values associated
821    /// with the header name.
822    ///
823    /// Input:
824    ///   GET /foo HTTP/1.1
825    ///   my-header: foo
826    ///
827    /// Config:
828    ///   add:
829    ///   - name: "my-header"
830    ///     value: "bar,baz"
831    ///
832    /// Output:
833    ///   GET /foo HTTP/1.1
834    ///   my-header: foo,bar,baz
835    #[serde(default, skip_serializing_if = "Option::is_none")]
836    pub add: Option<Vec<GrpcRouteRulesBackendRefsFiltersResponseHeaderModifierAdd>>,
837    /// Remove the given header(s) from the HTTP request before the action. The
838    /// value of Remove is a list of HTTP header names. Note that the header
839    /// names are case-insensitive (see
840    /// <https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).>
841    ///
842    /// Input:
843    ///   GET /foo HTTP/1.1
844    ///   my-header1: foo
845    ///   my-header2: bar
846    ///   my-header3: baz
847    ///
848    /// Config:
849    ///   remove: ["my-header1", "my-header3"]
850    ///
851    /// Output:
852    ///   GET /foo HTTP/1.1
853    ///   my-header2: bar
854    #[serde(default, skip_serializing_if = "Option::is_none")]
855    pub remove: Option<Vec<String>>,
856    /// Set overwrites the request with the given header (name, value)
857    /// before the action.
858    ///
859    /// Input:
860    ///   GET /foo HTTP/1.1
861    ///   my-header: foo
862    ///
863    /// Config:
864    ///   set:
865    ///   - name: "my-header"
866    ///     value: "bar"
867    ///
868    /// Output:
869    ///   GET /foo HTTP/1.1
870    ///   my-header: bar
871    #[serde(default, skip_serializing_if = "Option::is_none")]
872    pub set: Option<Vec<GrpcRouteRulesBackendRefsFiltersResponseHeaderModifierSet>>,
873}
874
875/// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
876#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
877pub struct GrpcRouteRulesBackendRefsFiltersResponseHeaderModifierAdd {
878    /// Name is the name of the HTTP Header to be matched. Name matching MUST be
879    /// case-insensitive. (See <https://tools.ietf.org/html/rfc7230#section-3.2).>
880    ///
881    /// If multiple entries specify equivalent header names, the first entry with
882    /// an equivalent name MUST be considered for a match. Subsequent entries
883    /// with an equivalent header name MUST be ignored. Due to the
884    /// case-insensitivity of header names, "foo" and "Foo" are considered
885    /// equivalent.
886    pub name: String,
887    /// Value is the value of HTTP Header to be matched.
888    ///
889    /// Must consist of printable US-ASCII characters, optionally separated
890    /// by single tabs or spaces. See: <https://tools.ietf.org/html/rfc7230#section-3.2>
891    pub value: String,
892}
893
894/// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
895#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
896pub struct GrpcRouteRulesBackendRefsFiltersResponseHeaderModifierSet {
897    /// Name is the name of the HTTP Header to be matched. Name matching MUST be
898    /// case-insensitive. (See <https://tools.ietf.org/html/rfc7230#section-3.2).>
899    ///
900    /// If multiple entries specify equivalent header names, the first entry with
901    /// an equivalent name MUST be considered for a match. Subsequent entries
902    /// with an equivalent header name MUST be ignored. Due to the
903    /// case-insensitivity of header names, "foo" and "Foo" are considered
904    /// equivalent.
905    pub name: String,
906    /// Value is the value of HTTP Header to be matched.
907    ///
908    /// Must consist of printable US-ASCII characters, optionally separated
909    /// by single tabs or spaces. See: <https://tools.ietf.org/html/rfc7230#section-3.2>
910    pub value: String,
911}
912
913/// GRPCRouteFilter defines processing steps that must be completed during the
914/// request or response lifecycle. GRPCRouteFilters are meant as an extension
915/// point to express processing that may be done in Gateway implementations. Some
916/// examples include request or response modification, implementing
917/// authentication strategies, rate-limiting, and traffic shaping. API
918/// guarantee/conformance is defined based on the type of the filter.
919#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
920pub enum GrpcRouteRulesBackendRefsFiltersType {
921    ResponseHeaderModifier,
922    RequestHeaderModifier,
923    RequestMirror,
924    ExtensionRef,
925}
926
927/// GRPCRouteFilter defines processing steps that must be completed during the
928/// request or response lifecycle. GRPCRouteFilters are meant as an extension
929/// point to express processing that may be done in Gateway implementations. Some
930/// examples include request or response modification, implementing
931/// authentication strategies, rate-limiting, and traffic shaping. API
932/// guarantee/conformance is defined based on the type of the filter.
933#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
934pub struct GrpcRouteRulesFilters {
935    /// ExtensionRef is an optional, implementation-specific extension to the
936    /// "filter" behavior.  For example, resource "myroutefilter" in group
937    /// "networking.example.net"). ExtensionRef MUST NOT be used for core and
938    /// extended filters.
939    ///
940    /// Support: Implementation-specific
941    ///
942    /// This filter can be used multiple times within the same rule.
943    #[serde(default, skip_serializing_if = "Option::is_none", rename = "extensionRef")]
944    pub extension_ref: Option<GrpcRouteRulesFiltersExtensionRef>,
945    /// RequestHeaderModifier defines a schema for a filter that modifies request
946    /// headers.
947    ///
948    /// Support: Core
949    #[serde(default, skip_serializing_if = "Option::is_none", rename = "requestHeaderModifier")]
950    pub request_header_modifier: Option<GrpcRouteRulesFiltersRequestHeaderModifier>,
951    /// RequestMirror defines a schema for a filter that mirrors requests.
952    /// Requests are sent to the specified destination, but responses from
953    /// that destination are ignored.
954    ///
955    /// This filter can be used multiple times within the same rule. Note that
956    /// not all implementations will be able to support mirroring to multiple
957    /// backends.
958    ///
959    /// Support: Extended
960    #[serde(default, skip_serializing_if = "Option::is_none", rename = "requestMirror")]
961    pub request_mirror: Option<GrpcRouteRulesFiltersRequestMirror>,
962    /// ResponseHeaderModifier defines a schema for a filter that modifies response
963    /// headers.
964    ///
965    /// Support: Extended
966    #[serde(default, skip_serializing_if = "Option::is_none", rename = "responseHeaderModifier")]
967    pub response_header_modifier: Option<GrpcRouteRulesFiltersResponseHeaderModifier>,
968    /// Type identifies the type of filter to apply. As with other API fields,
969    /// types are classified into three conformance levels:
970    ///
971    /// - Core: Filter types and their corresponding configuration defined by
972    ///   "Support: Core" in this package, e.g. "RequestHeaderModifier". All
973    ///   implementations supporting GRPCRoute MUST support core filters.
974    ///
975    /// - Extended: Filter types and their corresponding configuration defined by
976    ///   "Support: Extended" in this package, e.g. "RequestMirror". Implementers
977    ///   are encouraged to support extended filters.
978    ///
979    /// - Implementation-specific: Filters that are defined and supported by specific vendors.
980    ///   In the future, filters showing convergence in behavior across multiple
981    ///   implementations will be considered for inclusion in extended or core
982    ///   conformance levels. Filter-specific configuration for such filters
983    ///   is specified using the ExtensionRef field. `Type` MUST be set to
984    ///   "ExtensionRef" for custom filters.
985    ///
986    /// Implementers are encouraged to define custom implementation types to
987    /// extend the core API with implementation-specific behavior.
988    ///
989    /// If a reference to a custom filter type cannot be resolved, the filter
990    /// MUST NOT be skipped. Instead, requests that would have been processed by
991    /// that filter MUST receive a HTTP error response.
992    #[serde(rename = "type")]
993    pub r#type: GrpcRouteRulesFiltersType,
994}
995
996/// ExtensionRef is an optional, implementation-specific extension to the
997/// "filter" behavior.  For example, resource "myroutefilter" in group
998/// "networking.example.net"). ExtensionRef MUST NOT be used for core and
999/// extended filters.
1000///
1001/// Support: Implementation-specific
1002///
1003/// This filter can be used multiple times within the same rule.
1004#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1005pub struct GrpcRouteRulesFiltersExtensionRef {
1006    /// Group is the group of the referent. For example, "gateway.networking.k8s.io".
1007    /// When unspecified or empty string, core API group is inferred.
1008    pub group: String,
1009    /// Kind is kind of the referent. For example "HTTPRoute" or "Service".
1010    pub kind: String,
1011    /// Name is the name of the referent.
1012    pub name: String,
1013}
1014
1015/// RequestHeaderModifier defines a schema for a filter that modifies request
1016/// headers.
1017///
1018/// Support: Core
1019#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1020pub struct GrpcRouteRulesFiltersRequestHeaderModifier {
1021    /// Add adds the given header(s) (name, value) to the request
1022    /// before the action. It appends to any existing values associated
1023    /// with the header name.
1024    ///
1025    /// Input:
1026    ///   GET /foo HTTP/1.1
1027    ///   my-header: foo
1028    ///
1029    /// Config:
1030    ///   add:
1031    ///   - name: "my-header"
1032    ///     value: "bar,baz"
1033    ///
1034    /// Output:
1035    ///   GET /foo HTTP/1.1
1036    ///   my-header: foo,bar,baz
1037    #[serde(default, skip_serializing_if = "Option::is_none")]
1038    pub add: Option<Vec<GrpcRouteRulesFiltersRequestHeaderModifierAdd>>,
1039    /// Remove the given header(s) from the HTTP request before the action. The
1040    /// value of Remove is a list of HTTP header names. Note that the header
1041    /// names are case-insensitive (see
1042    /// <https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).>
1043    ///
1044    /// Input:
1045    ///   GET /foo HTTP/1.1
1046    ///   my-header1: foo
1047    ///   my-header2: bar
1048    ///   my-header3: baz
1049    ///
1050    /// Config:
1051    ///   remove: ["my-header1", "my-header3"]
1052    ///
1053    /// Output:
1054    ///   GET /foo HTTP/1.1
1055    ///   my-header2: bar
1056    #[serde(default, skip_serializing_if = "Option::is_none")]
1057    pub remove: Option<Vec<String>>,
1058    /// Set overwrites the request with the given header (name, value)
1059    /// before the action.
1060    ///
1061    /// Input:
1062    ///   GET /foo HTTP/1.1
1063    ///   my-header: foo
1064    ///
1065    /// Config:
1066    ///   set:
1067    ///   - name: "my-header"
1068    ///     value: "bar"
1069    ///
1070    /// Output:
1071    ///   GET /foo HTTP/1.1
1072    ///   my-header: bar
1073    #[serde(default, skip_serializing_if = "Option::is_none")]
1074    pub set: Option<Vec<GrpcRouteRulesFiltersRequestHeaderModifierSet>>,
1075}
1076
1077/// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
1078#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1079pub struct GrpcRouteRulesFiltersRequestHeaderModifierAdd {
1080    /// Name is the name of the HTTP Header to be matched. Name matching MUST be
1081    /// case-insensitive. (See <https://tools.ietf.org/html/rfc7230#section-3.2).>
1082    ///
1083    /// If multiple entries specify equivalent header names, the first entry with
1084    /// an equivalent name MUST be considered for a match. Subsequent entries
1085    /// with an equivalent header name MUST be ignored. Due to the
1086    /// case-insensitivity of header names, "foo" and "Foo" are considered
1087    /// equivalent.
1088    pub name: String,
1089    /// Value is the value of HTTP Header to be matched.
1090    ///
1091    /// Must consist of printable US-ASCII characters, optionally separated
1092    /// by single tabs or spaces. See: <https://tools.ietf.org/html/rfc7230#section-3.2>
1093    pub value: String,
1094}
1095
1096/// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
1097#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1098pub struct GrpcRouteRulesFiltersRequestHeaderModifierSet {
1099    /// Name is the name of the HTTP Header to be matched. Name matching MUST be
1100    /// case-insensitive. (See <https://tools.ietf.org/html/rfc7230#section-3.2).>
1101    ///
1102    /// If multiple entries specify equivalent header names, the first entry with
1103    /// an equivalent name MUST be considered for a match. Subsequent entries
1104    /// with an equivalent header name MUST be ignored. Due to the
1105    /// case-insensitivity of header names, "foo" and "Foo" are considered
1106    /// equivalent.
1107    pub name: String,
1108    /// Value is the value of HTTP Header to be matched.
1109    ///
1110    /// Must consist of printable US-ASCII characters, optionally separated
1111    /// by single tabs or spaces. See: <https://tools.ietf.org/html/rfc7230#section-3.2>
1112    pub value: String,
1113}
1114
1115/// RequestMirror defines a schema for a filter that mirrors requests.
1116/// Requests are sent to the specified destination, but responses from
1117/// that destination are ignored.
1118///
1119/// This filter can be used multiple times within the same rule. Note that
1120/// not all implementations will be able to support mirroring to multiple
1121/// backends.
1122///
1123/// Support: Extended
1124#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1125pub struct GrpcRouteRulesFiltersRequestMirror {
1126    /// BackendRef references a resource where mirrored requests are sent.
1127    ///
1128    /// Mirrored requests must be sent only to a single destination endpoint
1129    /// within this BackendRef, irrespective of how many endpoints are present
1130    /// within this BackendRef.
1131    ///
1132    /// If the referent cannot be found, this BackendRef is invalid and must be
1133    /// dropped from the Gateway. The controller must ensure the "ResolvedRefs"
1134    /// condition on the Route status is set to `status: False` and not configure
1135    /// this backend in the underlying implementation.
1136    ///
1137    /// If there is a cross-namespace reference to an *existing* object
1138    /// that is not allowed by a ReferenceGrant, the controller must ensure the
1139    /// "ResolvedRefs"  condition on the Route is set to `status: False`,
1140    /// with the "RefNotPermitted" reason and not configure this backend in the
1141    /// underlying implementation.
1142    ///
1143    /// In either error case, the Message of the `ResolvedRefs` Condition
1144    /// should be used to provide more detail about the problem.
1145    ///
1146    /// Support: Extended for Kubernetes Service
1147    ///
1148    /// Support: Implementation-specific for any other resource
1149    #[serde(rename = "backendRef")]
1150    pub backend_ref: GrpcRouteRulesFiltersRequestMirrorBackendRef,
1151    /// Fraction represents the fraction of requests that should be
1152    /// mirrored to BackendRef.
1153    ///
1154    /// Only one of Fraction or Percent may be specified. If neither field
1155    /// is specified, 100% of requests will be mirrored.
1156    #[serde(default, skip_serializing_if = "Option::is_none")]
1157    pub fraction: Option<GrpcRouteRulesFiltersRequestMirrorFraction>,
1158    /// Percent represents the percentage of requests that should be
1159    /// mirrored to BackendRef. Its minimum value is 0 (indicating 0% of
1160    /// requests) and its maximum value is 100 (indicating 100% of requests).
1161    ///
1162    /// Only one of Fraction or Percent may be specified. If neither field
1163    /// is specified, 100% of requests will be mirrored.
1164    #[serde(default, skip_serializing_if = "Option::is_none")]
1165    pub percent: Option<i32>,
1166}
1167
1168/// BackendRef references a resource where mirrored requests are sent.
1169///
1170/// Mirrored requests must be sent only to a single destination endpoint
1171/// within this BackendRef, irrespective of how many endpoints are present
1172/// within this BackendRef.
1173///
1174/// If the referent cannot be found, this BackendRef is invalid and must be
1175/// dropped from the Gateway. The controller must ensure the "ResolvedRefs"
1176/// condition on the Route status is set to `status: False` and not configure
1177/// this backend in the underlying implementation.
1178///
1179/// If there is a cross-namespace reference to an *existing* object
1180/// that is not allowed by a ReferenceGrant, the controller must ensure the
1181/// "ResolvedRefs"  condition on the Route is set to `status: False`,
1182/// with the "RefNotPermitted" reason and not configure this backend in the
1183/// underlying implementation.
1184///
1185/// In either error case, the Message of the `ResolvedRefs` Condition
1186/// should be used to provide more detail about the problem.
1187///
1188/// Support: Extended for Kubernetes Service
1189///
1190/// Support: Implementation-specific for any other resource
1191#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1192pub struct GrpcRouteRulesFiltersRequestMirrorBackendRef {
1193    /// Group is the group of the referent. For example, "gateway.networking.k8s.io".
1194    /// When unspecified or empty string, core API group is inferred.
1195    #[serde(default, skip_serializing_if = "Option::is_none")]
1196    pub group: Option<String>,
1197    /// Kind is the Kubernetes resource kind of the referent. For example
1198    /// "Service".
1199    ///
1200    /// Defaults to "Service" when not specified.
1201    ///
1202    /// ExternalName services can refer to CNAME DNS records that may live
1203    /// outside of the cluster and as such are difficult to reason about in
1204    /// terms of conformance. They also may not be safe to forward to (see
1205    /// CVE-2021-25740 for more information). Implementations SHOULD NOT
1206    /// support ExternalName Services.
1207    ///
1208    /// Support: Core (Services with a type other than ExternalName)
1209    ///
1210    /// Support: Implementation-specific (Services with type ExternalName)
1211    #[serde(default, skip_serializing_if = "Option::is_none")]
1212    pub kind: Option<String>,
1213    /// Name is the name of the referent.
1214    pub name: String,
1215    /// Namespace is the namespace of the backend. When unspecified, the local
1216    /// namespace is inferred.
1217    ///
1218    /// Note that when a namespace different than the local namespace is specified,
1219    /// a ReferenceGrant object is required in the referent namespace to allow that
1220    /// namespace's owner to accept the reference. See the ReferenceGrant
1221    /// documentation for details.
1222    ///
1223    /// Support: Core
1224    #[serde(default, skip_serializing_if = "Option::is_none")]
1225    pub namespace: Option<String>,
1226    /// Port specifies the destination port number to use for this resource.
1227    /// Port is required when the referent is a Kubernetes Service. In this
1228    /// case, the port number is the service port number, not the target port.
1229    /// For other resources, destination port might be derived from the referent
1230    /// resource or this field.
1231    #[serde(default, skip_serializing_if = "Option::is_none")]
1232    pub port: Option<i32>,
1233}
1234
1235/// Fraction represents the fraction of requests that should be
1236/// mirrored to BackendRef.
1237///
1238/// Only one of Fraction or Percent may be specified. If neither field
1239/// is specified, 100% of requests will be mirrored.
1240#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1241pub struct GrpcRouteRulesFiltersRequestMirrorFraction {
1242    #[serde(default, skip_serializing_if = "Option::is_none")]
1243    pub denominator: Option<i32>,
1244    pub numerator: i32,
1245}
1246
1247/// ResponseHeaderModifier defines a schema for a filter that modifies response
1248/// headers.
1249///
1250/// Support: Extended
1251#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1252pub struct GrpcRouteRulesFiltersResponseHeaderModifier {
1253    /// Add adds the given header(s) (name, value) to the request
1254    /// before the action. It appends to any existing values associated
1255    /// with the header name.
1256    ///
1257    /// Input:
1258    ///   GET /foo HTTP/1.1
1259    ///   my-header: foo
1260    ///
1261    /// Config:
1262    ///   add:
1263    ///   - name: "my-header"
1264    ///     value: "bar,baz"
1265    ///
1266    /// Output:
1267    ///   GET /foo HTTP/1.1
1268    ///   my-header: foo,bar,baz
1269    #[serde(default, skip_serializing_if = "Option::is_none")]
1270    pub add: Option<Vec<GrpcRouteRulesFiltersResponseHeaderModifierAdd>>,
1271    /// Remove the given header(s) from the HTTP request before the action. The
1272    /// value of Remove is a list of HTTP header names. Note that the header
1273    /// names are case-insensitive (see
1274    /// <https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).>
1275    ///
1276    /// Input:
1277    ///   GET /foo HTTP/1.1
1278    ///   my-header1: foo
1279    ///   my-header2: bar
1280    ///   my-header3: baz
1281    ///
1282    /// Config:
1283    ///   remove: ["my-header1", "my-header3"]
1284    ///
1285    /// Output:
1286    ///   GET /foo HTTP/1.1
1287    ///   my-header2: bar
1288    #[serde(default, skip_serializing_if = "Option::is_none")]
1289    pub remove: Option<Vec<String>>,
1290    /// Set overwrites the request with the given header (name, value)
1291    /// before the action.
1292    ///
1293    /// Input:
1294    ///   GET /foo HTTP/1.1
1295    ///   my-header: foo
1296    ///
1297    /// Config:
1298    ///   set:
1299    ///   - name: "my-header"
1300    ///     value: "bar"
1301    ///
1302    /// Output:
1303    ///   GET /foo HTTP/1.1
1304    ///   my-header: bar
1305    #[serde(default, skip_serializing_if = "Option::is_none")]
1306    pub set: Option<Vec<GrpcRouteRulesFiltersResponseHeaderModifierSet>>,
1307}
1308
1309/// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
1310#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1311pub struct GrpcRouteRulesFiltersResponseHeaderModifierAdd {
1312    /// Name is the name of the HTTP Header to be matched. Name matching MUST be
1313    /// case-insensitive. (See <https://tools.ietf.org/html/rfc7230#section-3.2).>
1314    ///
1315    /// If multiple entries specify equivalent header names, the first entry with
1316    /// an equivalent name MUST be considered for a match. Subsequent entries
1317    /// with an equivalent header name MUST be ignored. Due to the
1318    /// case-insensitivity of header names, "foo" and "Foo" are considered
1319    /// equivalent.
1320    pub name: String,
1321    /// Value is the value of HTTP Header to be matched.
1322    ///
1323    /// Must consist of printable US-ASCII characters, optionally separated
1324    /// by single tabs or spaces. See: <https://tools.ietf.org/html/rfc7230#section-3.2>
1325    pub value: String,
1326}
1327
1328/// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
1329#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1330pub struct GrpcRouteRulesFiltersResponseHeaderModifierSet {
1331    /// Name is the name of the HTTP Header to be matched. Name matching MUST be
1332    /// case-insensitive. (See <https://tools.ietf.org/html/rfc7230#section-3.2).>
1333    ///
1334    /// If multiple entries specify equivalent header names, the first entry with
1335    /// an equivalent name MUST be considered for a match. Subsequent entries
1336    /// with an equivalent header name MUST be ignored. Due to the
1337    /// case-insensitivity of header names, "foo" and "Foo" are considered
1338    /// equivalent.
1339    pub name: String,
1340    /// Value is the value of HTTP Header to be matched.
1341    ///
1342    /// Must consist of printable US-ASCII characters, optionally separated
1343    /// by single tabs or spaces. See: <https://tools.ietf.org/html/rfc7230#section-3.2>
1344    pub value: String,
1345}
1346
1347/// GRPCRouteFilter defines processing steps that must be completed during the
1348/// request or response lifecycle. GRPCRouteFilters are meant as an extension
1349/// point to express processing that may be done in Gateway implementations. Some
1350/// examples include request or response modification, implementing
1351/// authentication strategies, rate-limiting, and traffic shaping. API
1352/// guarantee/conformance is defined based on the type of the filter.
1353#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
1354pub enum GrpcRouteRulesFiltersType {
1355    ResponseHeaderModifier,
1356    RequestHeaderModifier,
1357    RequestMirror,
1358    ExtensionRef,
1359}
1360
1361/// GRPCRouteMatch defines the predicate used to match requests to a given
1362/// action. Multiple match types are ANDed together, i.e. the match will
1363/// evaluate to true only if all conditions are satisfied.
1364///
1365/// For example, the match below will match a gRPC request only if its service
1366/// is `foo` AND it contains the `version: v1` header:
1367///
1368/// ```text
1369/// matches:
1370///   - method:
1371///     type: Exact
1372///     service: "foo"
1373///   - headers:
1374///     name: "version"
1375///     value "v1"
1376/// ```
1377#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1378pub struct GrpcRouteRulesMatches {
1379    /// Headers specifies gRPC request header matchers. Multiple match values are
1380    /// ANDed together, meaning, a request MUST match all the specified headers
1381    /// to select the route.
1382    #[serde(default, skip_serializing_if = "Option::is_none")]
1383    pub headers: Option<Vec<GrpcRouteRulesMatchesHeaders>>,
1384    /// Method specifies a gRPC request service/method matcher. If this field is
1385    /// not specified, all services and methods will match.
1386    #[serde(default, skip_serializing_if = "Option::is_none")]
1387    pub method: Option<GrpcRouteRulesMatchesMethod>,
1388}
1389
1390/// GRPCHeaderMatch describes how to select a gRPC route by matching gRPC request
1391/// headers.
1392#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1393pub struct GrpcRouteRulesMatchesHeaders {
1394    /// Name is the name of the gRPC Header to be matched.
1395    ///
1396    /// If multiple entries specify equivalent header names, only the first
1397    /// entry with an equivalent name MUST be considered for a match. Subsequent
1398    /// entries with an equivalent header name MUST be ignored. Due to the
1399    /// case-insensitivity of header names, "foo" and "Foo" are considered
1400    /// equivalent.
1401    pub name: String,
1402    /// Type specifies how to match against the value of the header.
1403    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
1404    pub r#type: Option<GrpcRouteRulesMatchesHeadersType>,
1405    /// Value is the value of the gRPC Header to be matched.
1406    pub value: String,
1407}
1408
1409/// GRPCHeaderMatch describes how to select a gRPC route by matching gRPC request
1410/// headers.
1411#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
1412pub enum GrpcRouteRulesMatchesHeadersType {
1413    Exact,
1414    RegularExpression,
1415}
1416
1417/// Method specifies a gRPC request service/method matcher. If this field is
1418/// not specified, all services and methods will match.
1419#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1420pub struct GrpcRouteRulesMatchesMethod {
1421    /// Value of the method to match against. If left empty or omitted, will
1422    /// match all services.
1423    ///
1424    /// At least one of Service and Method MUST be a non-empty string.
1425    #[serde(default, skip_serializing_if = "Option::is_none")]
1426    pub method: Option<String>,
1427    /// Value of the service to match against. If left empty or omitted, will
1428    /// match any service.
1429    ///
1430    /// At least one of Service and Method MUST be a non-empty string.
1431    #[serde(default, skip_serializing_if = "Option::is_none")]
1432    pub service: Option<String>,
1433    /// Type specifies how to match against the service and/or method.
1434    /// Support: Core (Exact with service and method specified)
1435    ///
1436    /// Support: Implementation-specific (Exact with method specified but no service specified)
1437    ///
1438    /// Support: Implementation-specific (RegularExpression)
1439    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
1440    pub r#type: Option<GrpcRouteRulesMatchesMethodType>,
1441}
1442
1443/// Method specifies a gRPC request service/method matcher. If this field is
1444/// not specified, all services and methods will match.
1445#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
1446pub enum GrpcRouteRulesMatchesMethodType {
1447    Exact,
1448    RegularExpression,
1449}
1450
1451/// SessionPersistence defines and configures session persistence
1452/// for the route rule.
1453///
1454/// Support: Extended
1455#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1456pub struct GrpcRouteRulesSessionPersistence {
1457    /// AbsoluteTimeout defines the absolute timeout of the persistent
1458    /// session. Once the AbsoluteTimeout duration has elapsed, the
1459    /// session becomes invalid.
1460    ///
1461    /// Support: Extended
1462    #[serde(default, skip_serializing_if = "Option::is_none", rename = "absoluteTimeout")]
1463    pub absolute_timeout: Option<String>,
1464    /// CookieConfig provides configuration settings that are specific
1465    /// to cookie-based session persistence.
1466    ///
1467    /// Support: Core
1468    #[serde(default, skip_serializing_if = "Option::is_none", rename = "cookieConfig")]
1469    pub cookie_config: Option<GrpcRouteRulesSessionPersistenceCookieConfig>,
1470    /// IdleTimeout defines the idle timeout of the persistent session.
1471    /// Once the session has been idle for more than the specified
1472    /// IdleTimeout duration, the session becomes invalid.
1473    ///
1474    /// Support: Extended
1475    #[serde(default, skip_serializing_if = "Option::is_none", rename = "idleTimeout")]
1476    pub idle_timeout: Option<String>,
1477    /// SessionName defines the name of the persistent session token
1478    /// which may be reflected in the cookie or the header. Users
1479    /// should avoid reusing session names to prevent unintended
1480    /// consequences, such as rejection or unpredictable behavior.
1481    ///
1482    /// Support: Implementation-specific
1483    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sessionName")]
1484    pub session_name: Option<String>,
1485    /// Type defines the type of session persistence such as through
1486    /// the use of a header or cookie. Defaults to cookie based session
1487    /// persistence.
1488    ///
1489    /// Support: Core for "Cookie" type
1490    ///
1491    /// Support: Extended for "Header" type
1492    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
1493    pub r#type: Option<GrpcRouteRulesSessionPersistenceType>,
1494}
1495
1496/// CookieConfig provides configuration settings that are specific
1497/// to cookie-based session persistence.
1498///
1499/// Support: Core
1500#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1501pub struct GrpcRouteRulesSessionPersistenceCookieConfig {
1502    /// LifetimeType specifies whether the cookie has a permanent or
1503    /// session-based lifetime. A permanent cookie persists until its
1504    /// specified expiry time, defined by the Expires or Max-Age cookie
1505    /// attributes, while a session cookie is deleted when the current
1506    /// session ends.
1507    ///
1508    /// When set to "Permanent", AbsoluteTimeout indicates the
1509    /// cookie's lifetime via the Expires or Max-Age cookie attributes
1510    /// and is required.
1511    ///
1512    /// When set to "Session", AbsoluteTimeout indicates the
1513    /// absolute lifetime of the cookie tracked by the gateway and
1514    /// is optional.
1515    ///
1516    /// Defaults to "Session".
1517    ///
1518    /// Support: Core for "Session" type
1519    ///
1520    /// Support: Extended for "Permanent" type
1521    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lifetimeType")]
1522    pub lifetime_type: Option<GrpcRouteRulesSessionPersistenceCookieConfigLifetimeType>,
1523}
1524
1525/// CookieConfig provides configuration settings that are specific
1526/// to cookie-based session persistence.
1527///
1528/// Support: Core
1529#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
1530pub enum GrpcRouteRulesSessionPersistenceCookieConfigLifetimeType {
1531    Permanent,
1532    Session,
1533}
1534
1535/// SessionPersistence defines and configures session persistence
1536/// for the route rule.
1537///
1538/// Support: Extended
1539#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
1540pub enum GrpcRouteRulesSessionPersistenceType {
1541    Cookie,
1542    Header,
1543}
1544
1545/// Spec defines the desired state of GRPCRoute.
1546#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
1547pub enum GrpcRouteUseDefaultGateways {
1548    All,
1549    None,
1550}
1551
1552/// Status defines the current state of GRPCRoute.
1553#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1554pub struct GrpcRouteStatus {
1555    /// Parents is a list of parent resources (usually Gateways) that are
1556    /// associated with the route, and the status of the route with respect to
1557    /// each parent. When this route attaches to a parent, the controller that
1558    /// manages the parent must add an entry to this list when the controller
1559    /// first sees the route and should update the entry as appropriate when the
1560    /// route or gateway is modified.
1561    ///
1562    /// Note that parent references that cannot be resolved by an implementation
1563    /// of this API will not be added to this list. Implementations of this API
1564    /// can only populate Route status for the Gateways/parent resources they are
1565    /// responsible for.
1566    ///
1567    /// A maximum of 32 Gateways will be represented in this list. An empty list
1568    /// means the route has not been attached to any Gateway.
1569    pub parents: Vec<GrpcRouteStatusParents>,
1570}
1571
1572/// RouteParentStatus describes the status of a route with respect to an
1573/// associated Parent.
1574#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1575pub struct GrpcRouteStatusParents {
1576    /// Conditions describes the status of the route with respect to the Gateway.
1577    /// Note that the route's availability is also subject to the Gateway's own
1578    /// status conditions and listener status.
1579    ///
1580    /// If the Route's ParentRef specifies an existing Gateway that supports
1581    /// Routes of this kind AND that Gateway's controller has sufficient access,
1582    /// then that Gateway's controller MUST set the "Accepted" condition on the
1583    /// Route, to indicate whether the route has been accepted or rejected by the
1584    /// Gateway, and why.
1585    ///
1586    /// A Route MUST be considered "Accepted" if at least one of the Route's
1587    /// rules is implemented by the Gateway.
1588    ///
1589    /// There are a number of cases where the "Accepted" condition may not be set
1590    /// due to lack of controller visibility, that includes when:
1591    ///
1592    /// * The Route refers to a nonexistent parent.
1593    /// * The Route is of a type that the controller does not support.
1594    /// * The Route is in a namespace to which the controller does not have access.
1595    pub conditions: Vec<Condition>,
1596    /// ControllerName is a domain/path string that indicates the name of the
1597    /// controller that wrote this status. This corresponds with the
1598    /// controllerName field on GatewayClass.
1599    ///
1600    /// Example: "example.net/gateway-controller".
1601    ///
1602    /// The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are
1603    /// valid Kubernetes names
1604    /// (<https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).>
1605    ///
1606    /// Controllers MUST populate this field when writing status. Controllers should ensure that
1607    /// entries to status populated with their ControllerName are cleaned up when they are no
1608    /// longer necessary.
1609    #[serde(rename = "controllerName")]
1610    pub controller_name: String,
1611    /// ParentRef corresponds with a ParentRef in the spec that this
1612    /// RouteParentStatus struct describes the status of.
1613    #[serde(rename = "parentRef")]
1614    pub parent_ref: GrpcRouteStatusParentsParentRef,
1615}
1616
1617/// ParentRef corresponds with a ParentRef in the spec that this
1618/// RouteParentStatus struct describes the status of.
1619#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1620pub struct GrpcRouteStatusParentsParentRef {
1621    /// Group is the group of the referent.
1622    /// When unspecified, "gateway.networking.k8s.io" is inferred.
1623    /// To set the core API group (such as for a "Service" kind referent),
1624    /// Group must be explicitly set to "" (empty string).
1625    ///
1626    /// Support: Core
1627    #[serde(default, skip_serializing_if = "Option::is_none")]
1628    pub group: Option<String>,
1629    /// Kind is kind of the referent.
1630    ///
1631    /// There are two kinds of parent resources with "Core" support:
1632    ///
1633    /// * Gateway (Gateway conformance profile)
1634    /// * Service (Mesh conformance profile, ClusterIP Services only)
1635    ///
1636    /// Support for other resources is Implementation-Specific.
1637    #[serde(default, skip_serializing_if = "Option::is_none")]
1638    pub kind: Option<String>,
1639    /// Name is the name of the referent.
1640    ///
1641    /// Support: Core
1642    pub name: String,
1643    /// Namespace is the namespace of the referent. When unspecified, this refers
1644    /// to the local namespace of the Route.
1645    ///
1646    /// Note that there are specific rules for ParentRefs which cross namespace
1647    /// boundaries. Cross-namespace references are only valid if they are explicitly
1648    /// allowed by something in the namespace they are referring to. For example:
1649    /// Gateway has the AllowedRoutes field, and ReferenceGrant provides a
1650    /// generic way to enable any other kind of cross-namespace reference.
1651    ///
1652    ///
1653    /// ParentRefs from a Route to a Service in the same namespace are "producer"
1654    /// routes, which apply default routing rules to inbound connections from
1655    /// any namespace to the Service.
1656    ///
1657    /// ParentRefs from a Route to a Service in a different namespace are
1658    /// "consumer" routes, and these routing rules are only applied to outbound
1659    /// connections originating from the same namespace as the Route, for which
1660    /// the intended destination of the connections are a Service targeted as a
1661    /// ParentRef of the Route.
1662    ///
1663    ///
1664    /// Support: Core
1665    #[serde(default, skip_serializing_if = "Option::is_none")]
1666    pub namespace: Option<String>,
1667    /// Port is the network port this Route targets. It can be interpreted
1668    /// differently based on the type of parent resource.
1669    ///
1670    /// When the parent resource is a Gateway, this targets all listeners
1671    /// listening on the specified port that also support this kind of Route(and
1672    /// select this Route). It's not recommended to set `Port` unless the
1673    /// networking behaviors specified in a Route must apply to a specific port
1674    /// as opposed to a listener(s) whose port(s) may be changed. When both Port
1675    /// and SectionName are specified, the name and port of the selected listener
1676    /// must match both specified values.
1677    ///
1678    ///
1679    /// When the parent resource is a Service, this targets a specific port in the
1680    /// Service spec. When both Port (experimental) and SectionName are specified,
1681    /// the name and port of the selected port must match both specified values.
1682    ///
1683    ///
1684    /// Implementations MAY choose to support other parent resources.
1685    /// Implementations supporting other types of parent resources MUST clearly
1686    /// document how/if Port is interpreted.
1687    ///
1688    /// For the purpose of status, an attachment is considered successful as
1689    /// long as the parent resource accepts it partially. For example, Gateway
1690    /// listeners can restrict which Routes can attach to them by Route kind,
1691    /// namespace, or hostname. If 1 of 2 Gateway listeners accept attachment
1692    /// from the referencing Route, the Route MUST be considered successfully
1693    /// attached. If no Gateway listeners accept attachment from this Route,
1694    /// the Route MUST be considered detached from the Gateway.
1695    ///
1696    /// Support: Extended
1697    #[serde(default, skip_serializing_if = "Option::is_none")]
1698    pub port: Option<i32>,
1699    /// SectionName is the name of a section within the target resource. In the
1700    /// following resources, SectionName is interpreted as the following:
1701    ///
1702    /// * Gateway: Listener name. When both Port (experimental) and SectionName
1703    /// are specified, the name and port of the selected listener must match
1704    /// both specified values.
1705    /// * Service: Port name. When both Port (experimental) and SectionName
1706    /// are specified, the name and port of the selected listener must match
1707    /// both specified values.
1708    ///
1709    /// Implementations MAY choose to support attaching Routes to other resources.
1710    /// If that is the case, they MUST clearly document how SectionName is
1711    /// interpreted.
1712    ///
1713    /// When unspecified (empty string), this will reference the entire resource.
1714    /// For the purpose of status, an attachment is considered successful if at
1715    /// least one section in the parent resource accepts it. For example, Gateway
1716    /// listeners can restrict which Routes can attach to them by Route kind,
1717    /// namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from
1718    /// the referencing Route, the Route MUST be considered successfully
1719    /// attached. If no Gateway listeners accept attachment from this Route, the
1720    /// Route MUST be considered detached from the Gateway.
1721    ///
1722    /// Support: Core
1723    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sectionName")]
1724    pub section_name: Option<String>,
1725}