gateway_api/apis/experimental/tcproutes.rs
1// WARNING: generated file - manual changes will be overriden
2
3use super::common::*;
4#[allow(unused_imports)]
5mod prelude {
6 pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
7 pub use kube_derive::CustomResource;
8 pub use schemars::JsonSchema;
9 pub use serde::{Deserialize, Serialize};
10}
11use self::prelude::*;
12/// Spec defines the desired state of TCPRoute.
13#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
14#[kube(
15 group = "gateway.networking.k8s.io",
16 version = "v1alpha2",
17 kind = "TCPRoute",
18 plural = "tcproutes"
19)]
20#[kube(namespaced)]
21#[kube(status = "RouteStatus")]
22#[kube(derive = "Default")]
23#[kube(derive = "PartialEq")]
24pub struct TCPRouteSpec {
25 /// ParentRefs references the resources (usually Gateways) that a Route wants
26 /// to be attached to. Note that the referenced parent resource needs to
27 /// allow this for the attachment to be complete. For Gateways, that means
28 /// the Gateway needs to allow attachment from Routes of this kind and
29 /// namespace. For Services, that means the Service must either be in the same
30 /// namespace for a "producer" route, or the mesh implementation must support
31 /// and allow "consumer" routes for the referenced Service. ReferenceGrant is
32 /// not applicable for governing ParentRefs to Services - it is not possible to
33 /// create a "producer" route for a Service in a different namespace from the
34 /// Route.
35 ///
36 /// There are two kinds of parent resources with "Core" support:
37 ///
38 /// * Gateway (Gateway conformance profile)
39 /// * Service (Mesh conformance profile, ClusterIP Services only)
40 ///
41 /// This API may be extended in the future to support additional kinds of parent
42 /// resources.
43 ///
44 /// ParentRefs must be _distinct_. This means either that:
45 ///
46 /// * They select different objects. If this is the case, then parentRef
47 /// entries are distinct. In terms of fields, this means that the
48 /// multi-part key defined by `group`, `kind`, `namespace`, and `name` must
49 /// be unique across all parentRef entries in the Route.
50 /// * They do not select different objects, but for each optional field used,
51 /// each ParentRef that selects the same object must set the same set of
52 /// optional fields to different values. If one ParentRef sets a
53 /// combination of optional fields, all must set the same combination.
54 ///
55 /// Some examples:
56 ///
57 /// * If one ParentRef sets `sectionName`, all ParentRefs referencing the
58 /// same object must also set `sectionName`.
59 /// * If one ParentRef sets `port`, all ParentRefs referencing the same
60 /// object must also set `port`.
61 /// * If one ParentRef sets `sectionName` and `port`, all ParentRefs
62 /// referencing the same object must also set `sectionName` and `port`.
63 ///
64 /// It is possible to separately reference multiple distinct objects that may
65 /// be collapsed by an implementation. For example, some implementations may
66 /// choose to merge compatible Gateway Listeners together. If that is the
67 /// case, the list of routes attached to those resources should also be
68 /// merged.
69 ///
70 /// Note that for ParentRefs that cross namespace boundaries, there are specific
71 /// rules. Cross-namespace references are only valid if they are explicitly
72 /// allowed by something in the namespace they are referring to. For example,
73 /// Gateway has the AllowedRoutes field, and ReferenceGrant provides a
74 /// generic way to enable other kinds of cross-namespace reference.
75 ///
76 ///
77 /// ParentRefs from a Route to a Service in the same namespace are "producer"
78 /// routes, which apply default routing rules to inbound connections from
79 /// any namespace to the Service.
80 ///
81 /// ParentRefs from a Route to a Service in a different namespace are
82 /// "consumer" routes, and these routing rules are only applied to outbound
83 /// connections originating from the same namespace as the Route, for which
84 /// the intended destination of the connections are a Service targeted as a
85 /// ParentRef of the Route.
86 ///
87 ///
88 ///
89 ///
90 ///
91 ///
92 #[serde(
93 default,
94 skip_serializing_if = "Option::is_none",
95 rename = "parentRefs"
96 )]
97 pub parent_refs: Option<Vec<ParentReference>>,
98 /// Rules are a list of TCP matchers and actions.
99 ///
100 ///
101 pub rules: Vec<CommonRouteRule>,
102}