ListenerSet
gateway.networking.k8s.io/v1
Gateway API Versionv1.6.0
ListenerSet defines a set of additional listeners to attach to an existing Gateway.
This resource provides a mechanism to merge multiple listeners into a single Gateway.
The parent Gateway must explicitly allow ListenerSet attachment through its AllowedListeners configuration. By default, Gateways do not allow ListenerSet attachment.
Routes can attach to a ListenerSet by specifying it as a parentRef, and can optionally target specific listeners using the sectionName field.
Policy Attachment:
- Policies that attach to a ListenerSet apply to all listeners defined in that resource
- Policies do not impact listeners in the parent Gateway
- Different ListenerSets attached to the same Gateway can have different policies
- If an implementation cannot apply a policy to specific listeners, it should reject the policy
- ReferenceGrants applied to a Gateway are not inherited by child ListenerSets
- ReferenceGrants applied to a ListenerSet do not grant permission to the parent Gateway’s listeners
- A ListenerSet can reference secrets/backends in its own namespace without a ReferenceGrant
- The parent Gateway’s status will include “AttachedListenerSets” which is the count of ListenerSets that have successfully attached to a Gateway A ListenerSet is successfully attached to a Gateway when all the following conditions are met:
- The ListenerSet is selected by the Gateway’s AllowedListeners field
- The ListenerSet has a valid ParentRef selecting the Gateway
- The ListenerSet’s status has the condition “Accepted: true”
---
config:
theme: base
themeVariables:
secondaryColor: '#ffffff'
---
block
columns 7
classDef al_ref_box fill:#F2F2F2,stroke:#555;
classDef al_mgw_box fill:#70991F,stroke:#555;
classDef al_gwapi_box fill:#326CE5,stroke:#555;
classDef al_std_box fill:#808B8F,stroke:#555;
classDef al_self_box fill:#326CE5,stroke:#777,stroke-width:5px;
space:2
block:Targets:3
columns 3
Gateway["<a href='../../../gateway-api/gateway/v1'> Gateway </a>"]
space:2
class Gateway al_gwapi_box
end
class Targets al_ref_box
space:2
space:7
block:RefBy:1
columns 1
ReferenceGrant["<a href='../../../gateway-api/reference-grant/v1'> ReferenceGrant </a>"]
class ReferenceGrant al_gwapi_box
end
class RefBy al_ref_box
space:2
ListenerSet["<a href='../../../gateway-api/listener-set/v1'> <b>ListenerSet</b> </a>"]
class ListenerSet al_self_box
space:3
space:7
space:2
block:TargetedBy:3
columns 3
HTTPRoute["<a href='../../../gateway-api/http-route/v1'> HTTPRoute </a>"]
space:2
class HTTPRoute al_gwapi_box
end
class TargetedBy al_ref_box
space:2
ListenerSet -- "<i>attaches to</i>" --> Targets
RefBy -- "<br><i>references</i>" --> ListenerSet
TargetedBy -- "<i>attaches to</i>" --> ListenerSet
ListenerSet
| Field | Description | Type | Required | Default | Allowed Values |
|---|---|---|---|---|---|
| metadata | defines the resource’s metadata | ObjectMeta | yes | ||
| spec | defines the desired state of ListenerSet. | object | yes | ||
| status | defines the current state of ListenerSet. | object | no |
ListenerSet.spec
| Field | Description | Type | Required | Default | Allowed Values |
|---|---|---|---|---|---|
| listeners | associated with this ListenerSet. Listeners define logical endpoints that are bound on this referenced parent Gateway’s addresses. Listeners in a Gateway and their attached ListenerSets are concatenated as a list when programming the underlying infrastructure. Each listener name does not need to be unique across the Gateway and ListenerSets. See ListenerEntry.Name for more details. Implementations MUST treat the parent Gateway as having the merged list of all listeners from itself and attached ListenerSets using the following precedence:
Accepted condition to False with the Reason TooManyListeners If a listener has a conflict, this will be reported in the Status.ListenerEntryStatus setting the Conflicted condition to True. Implementations SHOULD be cautious about what information from the parent or siblings are reported to avoid accidentally leaking sensitive information that the child would not otherwise have access to. This can include contents of secrets etc. |
object[] | yes | ||
| parentRef | ParentRef references the Gateway that the listeners are attached to. Supported kinds: Gateway |
object | yes |
ListenerSet.spec.listeners[]
| Field | Description | Type | Required | Default | Allowed Values |
|---|---|---|---|---|---|
| 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:
|
object | no | ||
| 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:
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. Hostnames that are prefixed with a wildcard label ( *.) are interpreted as a suffix match. That means that a match for *.example.com would match both test.example.com, and foo.test.example.com, but not example.com. |
string | no | ||
| name | is the name of the Listener. This name MUST be unique within a ListenerSet. Name is not required to be unique across a Gateway and ListenerSets. Routes can attach to a Listener by having a ListenerSet as a parentRef and setting the SectionName |
string | yes | ||
| port | is the network port. Multiple listeners may use the same port, subject to the Listener compatibility rules. | int32 | yes | [1, 65535] |
|
| protocol | Protocol specifies the network protocol this listener expects to receive.
Supported protocols:
|
string | yes | ||
| 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 ListenerTLSConfig 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. |
object | no |
ListenerSet.spec.listeners[].allowedRoutes
| Field | Description | Type | Required | Default | Allowed Values |
|---|---|---|---|---|---|
| kinds |
Kinds specifies the groups and kinds of Routes that are allowed to bind to this Gateway Listener. When unspecified or empty, the kinds of Routes selected are determined using the Listener protocol. Supported kinds: HTTPRoute |
object[] | no | ||
| namespaces | indicates namespaces from which Routes may be attached to this Listener. This is restricted to the namespace of this Gateway by default. | object | no |
ListenerSet.spec.listeners[].allowedRoutes.kinds[]
| Field | Description | Type | Required | Default | Allowed Values |
|---|---|---|---|---|---|
| group | Group is the group of the Route.
Supported groups: |
string | no | gateway.networking.k8s.io |
|
| kind | Kind is the kind of the Route. Supported kinds: HTTPRoute |
string | yes |
ListenerSet.spec.listeners[].allowedRoutes.namespaces
| Field | Description | Type | Required | Default | Allowed Values |
|---|---|---|---|---|---|
| from | indicates where Routes will be selected for this Gateway. Possible values are: |
string | no | Same |
All, Same, Selector |
| selector | must be specified when From is set to “Selector”. In that case, only Routes in Namespaces matching this Selector will be selected by this Gateway. This field is ignored for other values of “From”. | LabelSelector | no |
ListenerSet.spec.listeners[].tls
| Field | Description | Type | Required | Default | Allowed Values |
|---|---|---|---|---|---|
| certificateRefs |
CertificateRefs contains a series of references to Kubernetes objects that contains TLS certificates and private keys. These certificates are used to establish a TLS handshake for requests that match the hostname of the associated listener. Supported kinds: Secret |
object[] | no | ||
| mode | defines the TLS behavior for the TLS session initiated by the client. There are two possible modes:
|
enum | no | Terminate |
Passthrough, Terminate |
| options |
Options are a list of key/value pairs to enable extended TLS configuration for each implementation. For example, configuring the minimum TLS version or supported cipher suites.
Supported options:
|
map[string]string | no |
ListenerSet.spec.listeners[].tls.certificateRefs[]
| Field | Description | Type | Required | Default | Allowed Values |
|---|---|---|---|---|---|
| group |
Group is the group of the referent. For example, “gateway.networking.k8s.io”.
Supported groups: |
string | no | "" |
|
| kind | Kind is kind of the referent. For example “Secret”. Supported kinds: Secret |
string | no | Secret |
|
| name | is the name of the referent. | string | yes | ||
| namespace | is the namespace of the referenced object. When unspecified, the local namespace is inferred. Note that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace’s owner to accept the reference. See the ReferenceGrant documentation for details. |
string | no |
ListenerSet.spec.parentRef
| Field | Description | Type | Required | Default | Allowed Values |
|---|---|---|---|---|---|
| group | Group is the group of the referent.
Supported groups: |
string | no | gateway.networking.k8s.io |
|
| kind | Kind is kind of the referent. For example “Gateway”. Supported kinds: Gateway |
string | no | Gateway |
|
| name | is the name of the referent. | string | yes | ||
| namespace | is the namespace of the referent. If not present, the namespace of the referent is assumed to be the same as the namespace of the referring object. | string | no |
ListenerSet.status
| Field | Description | Type |
|---|---|---|
| conditions | describe the current conditions of the ListenerSet.
Possible conditions:
|
Condition[] |
| listeners | provide status for each unique listener port defined in the Spec. | object[] |
ListenerSet.status.listeners[]
| Field | Description | Type |
|---|---|---|
| attachedRoutes | represents the total number of Routes that have been successfully attached to this Listener. Successful attachment of a Route to a Listener is based solely on the combination of the AllowedRoutes field on the corresponding Listener and the Route’s ParentRefs field. A Route is successfully attached to a Listener when it is selected by the Listener’s AllowedRoutes field AND the Route has a valid ParentRef selecting the whole Gateway resource or a specific Listener as a parent resource (more detail on attachment semantics can be found in the documentation on the various Route kinds ParentRefs fields). Listener status does not impact successful attachment, i.e. the AttachedRoutes field count MUST be set for Listeners, even if the Accepted condition of an individual Listener is set to “False”. The AttachedRoutes number represents the number of Routes with the Accepted condition set to “True” that have been attached to this Listener. Routes with any other value for the Accepted condition MUST NOT be included in this count. Uses for this field include troubleshooting Route attachment and measuring blast radius/impact of changes to a Listener. |
int32 |
| conditions | Conditions describe the current condition of this listener.
Possible conditions:
|
Condition[] |
| name | is the name of the Listener that this status corresponds to. | string |
| supportedKinds | is the list indicating the Kinds supported by this listener. This MUST represent the kinds supported by an implementation for that Listener configuration. If kinds are specified in Spec that are not supported, they MUST NOT appear in this list and an implementation MUST set the “ResolvedRefs” condition to “False” with the “InvalidRouteKinds” reason. If both valid and invalid Route kinds are specified, the implementation MUST reference the valid Route kinds that have been specified. |
object[] |
ListenerSet.status.listeners[].supportedKinds[]
| Field | Description | Type |
|---|---|---|
| group | is the group of the Route. | string |
| kind | is the kind of the Route. | string |