ListenerSetPolicy
ListenerSetPolicy is a Gwin custom resource for configuring listener-level policies for ListenerSet resources. It allows you to define HTTP protocol settings, stream timeouts, and ALB resource naming that apply to ListenerSet resources matched by name or label selector.
ListenerSetPolicy and ListenerSet annotations are equivalent ways to configure the same settings. Use ListenerSetPolicy when you want to apply the same settings to multiple ListenerSets or manage policy separately from the ListenerSet resource.
Cheatsheet
Note
Specification provided below is not valid configuration.
It's just demonstration of all ListenerSetPolicy fields.
apiVersion: gwin.yandex.cloud/v1
kind: ListenerSetPolicy
metadata:
name: my-policy
namespace: my-ns # policy only matches ListenerSets in the same namespace
spec:
targetRefs:
- kind: ListenerSet
name: my-listenerset # target a specific ListenerSet by name
selector:
matchLabels:
team: backend # or target all ListenerSets with this label
policy:
listeners: # applies to all listeners in matched ListenerSets
albListenerName: "my-alb-listener"
http:
protocolSettings:
allowHTTP10: "true"
http2Options:
maxConcurrentStreams: "100"
stream:
idleTimeout: "300s"
listener:
my-https-listener: # applies only to the listener named "my-https-listener"
albListenerName: "my-https-alb-listener"
albHTTPRouterName: "my-https-router"
http:
protocolSettings:
allowHTTP10: "false"
attach: # manage virtual hosts in an existing HTTP router
virtualHosts:
httpRouterID: "http-router-id"
| Field | Description |
|---|---|
| metadata | Standard Kubernetes metadata. |
| spec | ListenerSetPolicySpec Policy specification. |
| status | ListenerSetPolicyStatus Status populated by the controller. |
ListenerSetPolicySpec
Appears in: ListenerSetPolicy
The policy is restricted to ListenerSet resources within the same namespace.
When determining which resources the policy applies to, the following rules are used:
- If both
targetRefsandselectorare specified, a resource must match both criteria. - If neither is specified, the policy applies to all ListenerSets in the same namespace.
| Field | Description |
|---|---|
| targetRefs | []LocalObjectReference References to specific ListenerSets to target. |
| selector | LabelSelector Label selector for targeting ListenerSets. |
| policy | ListenerSetPolicyConfig The listener policy configuration. |
LocalObjectReference
Reference to a resource in the same namespace.
Appears in: ListenerSetPolicySpec
| Field | Description |
|---|---|
| group | string API group of the resource. Example: gateway.networking.k8s.io |
| kind | string Kind of the resource. Example: ListenerSet |
| name | string Name of the resource. Example: my-listenerset |
LabelSelector
Label-based selection criteria for ListenerSets.
Appears in: ListenerSetPolicySpec
| Field | Description |
|---|---|
| matchLabels | map[string]string Simple label matching requirements. Example: team: backend |
| matchExpressions | []LabelSelectorRequirement Advanced label matching expressions. |
LabelSelectorRequirement
Appears in: LabelSelector
| Field | Description |
|---|---|
| key | string Label key to match. Example: team |
| operator | string Matching operator. Example: In, NotIn, Exists. |
| values | []string Values to match against. Example: ["backend"] |
ListenerSetPolicyConfig
Policy configuration for listeners in the matched ListenerSet.
Appears in: ListenerSetPolicySpec
| Field | Description |
|---|---|
| listeners | GatewayListener Settings applied to all listeners in the matched ListenerSet. |
| listener | map[string]GatewayListener Per-listener settings, keyed by listener name. Override the listeners defaults for specific listeners. |
GatewayListener
Settings for a listener.
Appears in: ListenerSetPolicyConfig
| Field | Description |
|---|---|
| albListenerName | string Custom name for the ALB listener. Example: my-alb-listener |
| albHTTPRouterName | string Custom name for the ALB HTTP router. Example: my-http-router |
| http | ListenerHTTP HTTP-specific listener settings. |
| stream | ListenerStream Stream-specific listener settings. |
| attach | HTTPRouterAttach Make the controller manage virtual hosts inside an existing ALB HTTP router instead of creating its own. |
HTTPRouterAttach
Attachment to an existing cloud HTTP router.
Appears in: GatewayListener
| Field | Description |
|---|---|
| virtualHosts | VirtualHostsAttach Virtual hosts attachment configuration. |
VirtualHostsAttach
Appears in: HTTPRouterAttach
| Field | Description |
|---|---|
| httpRouterID | string Cloud HTTP router ID whose virtual hosts are managed by this listener. The controller manages the full lifecycle (create, update, delete) of those virtual hosts. Example: http-router-id |
Listener
Base listener settings (embedded in GatewayListener).
Appears in: GatewayListener
| Field | Description |
|---|---|
| albListenerName | string Custom name for the ALB listener. Example: my-alb-listener |
| http | ListenerHTTP HTTP-specific settings. |
| stream | ListenerStream Stream-specific settings. |
ListenerHTTP
HTTP-specific listener settings.
Appears in: GatewayListener
| Field | Description |
|---|---|
| protocolSettings | HTTPProtocolSettings HTTP protocol options. |
HTTPProtocolSettings
HTTP protocol options.
Appears in: ListenerHTTP
| Field | Description |
|---|---|
| allowHTTP10 | boolean Enables support for incoming HTTP/1.0 and HTTP/1.1 requests and disables it for HTTP/2 requests. Example: true |
| http2Options | HTTP2Options HTTP/2 connection settings. |
HTTP2Options
HTTP/2 connection settings.
Appears in: HTTPProtocolSettings
| Field | Description |
|---|---|
| maxConcurrentStreams | number Maximum number of concurrent HTTP/2 streams in a connection. Example: 100 |
ListenerStream
Stream listener settings.
Appears in: GatewayListener
| Field | Description |
|---|---|
| idleTimeout | duration Duration during which no data is transmitted or received on either the upstream or downstream connection before the connection is closed. Example: 300s |
ListenerSetPolicyStatus
Appears in: ListenerSetPolicy
| Field | Description |
|---|---|
| conditions | []Condition Policy conditions. Known type: Accepted. |
| attachedListenerSets | int32 Number of ListenerSets this policy is currently attached to. |