Configure GatewayAPI ListenerSet

Overview

Configure a ListenerSet to provide additional listeners for an existing Gateway. A ListenerSet is owned by its namespace and attaches to a Gateway through spec.parentRef.

ACP supports both listeners defined directly in Gateway.spec.listeners and listeners defined in a ListenerSet. A Gateway must explicitly allow ListenerSets; by default, it accepts none.

Prerequisites

Please ensure that you have completed the following before proceeding:

  1. Read Configure GatewayAPI Gateway to understand Gateway listeners and listener attachment rules.
  2. Create a Gateway and configure its ListenerSet namespace allowance.

Configuration

Configuration Via Web Console

  1. Navigate to Alauda Container Platform -> Networking -> Gateway -> ListenerSets.
  2. Click the Create ListenerSet button.
  3. Select the ListenerSet namespace and its parent Gateway.
  4. Add one or more listeners and configure their allowed Route namespaces.

The ListenerSet form contains the following fields:

FieldDescriptionYAML Path
NameName of the ListenerSet.metadata.name
NamespaceNamespace that owns the ListenerSet.metadata.namespace
Parent GatewayGateway that receives the listeners.spec.parentRef
ListenerPort, protocol, hostname, TLS, and allowed Route namespaces.spec.listeners[]

Configuration Via YAML

First configure the parent Gateway to allow ListenerSets from the required namespaces. See Allow ListenerSets on a Gateway.

Create a ListenerSet with spec.parentRef pointing to that Gateway:

apiVersion: gateway.networking.k8s.io/v1
kind: ListenerSet
metadata:
  name: app-listeners
  namespace: app-demo
spec:
  parentRef:
    name: edge
    namespace: gateway-system
  listeners:
    - name: app-http
      protocol: HTTP
      port: 8080
      allowedRoutes:
        namespaces:
          from: Same

Listener names only need to be unique within the ListenerSet. A ListenerSet in another namespace is accepted only when the parent Gateway's allowedListeners rule includes that namespace.

Attach a Route

A Route can attach to a Gateway listener or a ListenerSet listener. Set the parent reference kind to ListenerSet and use sectionName for the selected listener:

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: app-route
  namespace: app-demo
spec:
  parentRefs:
    - group: gateway.networking.k8s.io
      kind: ListenerSet
      namespace: app-demo
      name: app-listeners
      sectionName: app-http
  rules:
    - matches:
        - path:
            type: PathPrefix
            value: /app
      backendRefs:
        - name: app-service
          port: 80

The ListenerSet listener's allowedRoutes controls which Route namespaces may attach. The selected listener's protocol and hostname must also be compatible with the Route. For the complete Route workflow, see Attach a Route to a ListenerSet.

Policy behavior

Gateway-level policies without sectionName apply to the parent Gateway's merged listener configuration, including attached ListenerSet listeners.

On the ACP Envoy Gateway v1.8.0 line, the following policies support a Gateway target with an optional sectionName, but do not support a direct ListenerSet target:

  • SecurityPolicy
  • ClientTrafficPolicy
  • BackendTrafficPolicy
  • EnvoyExtensionPolicy

EnvoyPatchPolicy targets a Gateway or GatewayClass and is not a ListenerSet-specific policy entry point. Use a Gateway-level policy when the behavior should cover the Gateway and its attached ListenerSet listeners. Use a Route-level policy when the behavior belongs to a particular Route.

View ListenerSet Details

In the ListenerSet details page, view the parent Gateway, listener configuration, and status conditions. When troubleshooting an attachment, check the Gateway's status.attachedListenerSets, the ListenerSet Accepted and Programmed conditions, and each listener's status.

Next Step

After the ListenerSet is ready, continue with Configure GatewayAPI Route to attach Routes. If you need traffic or security policies, continue with Configure GatewayAPI Policy.

Trademark Notice

Envoy® is a registered trademark of The Linux Foundation.

Alauda is an independent vendor. This product is not affiliated with, endorsed by, or sponsored by The Linux Foundation. All trademarks are the property of their respective owners and are used here for identification purposes only.