pub struct TCPRouteSpec {
pub parent_refs: Option<Vec<TCPRouteParentRefs>>,
pub rules: Vec<TCPRouteRules>,
}
Expand description
Spec defines the desired state of TCPRoute.
Fields§
§parent_refs: Option<Vec<TCPRouteParentRefs>>
ParentRefs references the resources (usually Gateways) that a Route wants to be attached to. Note that the referenced parent resource needs to allow this for the attachment to be complete. For Gateways, that means the Gateway needs to allow attachment from Routes of this kind and namespace. For Services, that means the Service must either be in the same namespace for a “producer” route, or the mesh implementation must support and allow “consumer” routes for the referenced Service. ReferenceGrant is not applicable for governing ParentRefs to Services - it is not possible to create a “producer” route for a Service in a different namespace from the Route.
There are two kinds of parent resources with “Core” support:
- Gateway (Gateway conformance profile)
- Service (Mesh conformance profile, ClusterIP Services only)
This API may be extended in the future to support additional kinds of parent resources.
ParentRefs must be distinct. This means either that:
- They select different objects. If this is the case, then parentRef
entries are distinct. In terms of fields, this means that the
multi-part key defined by
group
,kind
,namespace
, andname
must be unique across all parentRef entries in the Route. - They do not select different objects, but for each optional field used, each ParentRef that selects the same object must set the same set of optional fields to different values. If one ParentRef sets a combination of optional fields, all must set the same combination.
Some examples:
- If one ParentRef sets
sectionName
, all ParentRefs referencing the same object must also setsectionName
. - If one ParentRef sets
port
, all ParentRefs referencing the same object must also setport
. - If one ParentRef sets
sectionName
andport
, all ParentRefs referencing the same object must also setsectionName
andport
.
It is possible to separately reference multiple distinct objects that may be collapsed by an implementation. For example, some implementations may choose to merge compatible Gateway Listeners together. If that is the case, the list of routes attached to those resources should also be merged.
Note that for ParentRefs that cross namespace boundaries, there are specific rules. Cross-namespace references are only valid if they are explicitly allowed by something in the namespace they are referring to. For example, Gateway has the AllowedRoutes field, and ReferenceGrant provides a generic way to enable other kinds of cross-namespace reference.
ParentRefs from a Route to a Service in the same namespace are “producer” routes, which apply default routing rules to inbound connections from any namespace to the Service.
ParentRefs from a Route to a Service in a different namespace are “consumer” routes, and these routing rules are only applied to outbound connections originating from the same namespace as the Route, for which the intended destination of the connections are a Service targeted as a ParentRef of the Route.
rules: Vec<TCPRouteRules>
Rules are a list of TCP matchers and actions.
Trait Implementations§
Source§impl Clone for TCPRouteSpec
impl Clone for TCPRouteSpec
Source§fn clone(&self) -> TCPRouteSpec
fn clone(&self) -> TCPRouteSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TCPRouteSpec
impl Debug for TCPRouteSpec
Source§impl Default for TCPRouteSpec
impl Default for TCPRouteSpec
Source§fn default() -> TCPRouteSpec
fn default() -> TCPRouteSpec
Source§impl<'de> Deserialize<'de> for TCPRouteSpec
impl<'de> Deserialize<'de> for TCPRouteSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for TCPRouteSpec
impl JsonSchema for TCPRouteSpec
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreSource§impl PartialEq for TCPRouteSpec
impl PartialEq for TCPRouteSpec
Source§impl Serialize for TCPRouteSpec
impl Serialize for TCPRouteSpec
impl StructuralPartialEq for TCPRouteSpec
Auto Trait Implementations§
impl Freeze for TCPRouteSpec
impl RefUnwindSafe for TCPRouteSpec
impl Send for TCPRouteSpec
impl Sync for TCPRouteSpec
impl Unpin for TCPRouteSpec
impl UnwindSafe for TCPRouteSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more