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