Struct k8s_gateway_api::Listener
source · [−]pub struct Listener {
pub name: String,
pub hostname: Option<Hostname>,
pub port: PortNumber,
pub protocol: ProtocolType,
pub tls: Option<GatewayTlsConfig>,
pub allowed_routes: Option<AllowedRoutes>,
}
Expand description
Listener embodies the concept of a logical endpoint where a Gateway accepts network connections.
Fields
name: String
Name is the name of the Listener. This name MUST be unique within a Gateway.
Support: Core
hostname: Option<Hostname>
Hostname specifies the virtual hostname to match for protocol types that define this concept. When unspecified, all hostnames are matched. This field is ignored for protocols that don’t require hostname based matching.
Implementations MUST apply Hostname matching appropriately for each of the following protocols:
- TLS: The Listener Hostname MUST match the SNI. * HTTP: The Listener Hostname MUST match the Host header of the request. * HTTPS: The Listener Hostname SHOULD match at both the TLS and HTTP protocol layers as described above. If an implementation does not ensure that both the SNI and Host header match the Listener hostname, it MUST clearly document that.
For HTTPRoute and TLSRoute resources, there is an interaction with the
spec.hostnames
array. When both listener and route specify hostnames,
there MUST be an intersection between the values for a Route to be
accepted. For more information, refer to the Route specific Hostnames
documentation.
Support: Core
port: PortNumber
Port is the network port. Multiple listeners may use the same port, subject to the Listener compatibility rules.
protocol: ProtocolType
Protocol specifies the network protocol this listener expects to receive.
Support: Core
tls: Option<GatewayTlsConfig>
TLS is the TLS configuration for the Listener. This field is required if the Protocol field is “HTTPS” or “TLS”. It is invalid to set this field if the Protocol field is “HTTP”, “TCP”, or “UDP”.
The association of SNIs to Certificate defined in GatewayTLSConfig is defined based on the Hostname field for this listener.
The GatewayClass MUST use the longest matching SNI out of all available certificates for any TLS handshake.
Support: Core
allowed_routes: Option<AllowedRoutes>
AllowedRoutes defines the types of routes that MAY be attached to a Listener and the trusted namespaces where those Route resources MAY be present.
Although a client request may match multiple route rules, only one rule may ultimately receive the request. Matching precedence MUST be determined in order of the following criteria:
- The most specific match as defined by the Route type.
- The oldest Route based on creation timestamp. For example, a Route with a creation timestamp of “2020-09-08 01:02:03” is given precedence over a Route with a creation timestamp of “2020-09-08 01:02:04”.
- If everything else is equivalent, the Route appearing first in alphabetical order (namespace/name) should be given precedence. For example, foo/bar is given precedence over foo/baz.
All valid rules within a Route attached to this Listener should be implemented. Invalid Route rules can be ignored (sometimes that will mean the full Route). If a Route rule transitions from valid to invalid, support for that Route rule should be dropped to ensure consistency. For example, even if a filter specified by a Route rule is invalid, the rest of the rules within that Route should still be supported.
Support: Core
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Listener
impl<'de> Deserialize<'de> for Listener
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl JsonSchema for Listener
impl JsonSchema for Listener
sourcefn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
sourcefn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
sourcefn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the $ref
keyword. Read more
impl StructuralPartialEq for Listener
Auto Trait Implementations
impl RefUnwindSafe for Listener
impl Send for Listener
impl Sync for Listener
impl Unpin for Listener
impl UnwindSafe for Listener
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more