Skip to main content
logoTetrate Istio SubscriptionVersion: Next

TIS1503 - Listener Must Have a Unique Combination of Hostname, Port, and Protocol

Each listener in a Kubernetes Gateway must have a unique combination of Hostname, Port, and Protocol.

Recommendation: Ensure Listener Uniqueness for Hostname, Port, and Protocol

To prevent conflicts and ensure predictable behavior, update the hostname, port, or protocol so that each listener in the Gateway has a unique combination of these attributes.

Examples

  1. Two Listeners with the Same Hostname, Port, and Protocol

    apiVersion: gateway.networking.k8s.io/v1alpha2
    kind: Gateway
    metadata:
    name: my-gateway
    namespace: example-namespace
    spec:
    listeners:
    - name: http-1
    port: 80
    protocol: HTTP
    hostname: "example.com"
    - name: http-2
    port: 80
    protocol: HTTP
    hostname: "example.com"

    Explanation: The Gateway defines two listeners that have the same Hostname (example.com), Port (80), and Protocol (HTTP). This configuration is invalid because each listener must have a unique combination of Hostname, Port, and Protocol to avoid conflicts and ensure predictable behavior.

Recommendation

Update the hostname, port, or protocol to ensure there is only one listener for the reported combination.

  1. Update One of the Listeners to Use a Different Port

    If the intent is to have separate listeners, modify one of the listeners to use a different port.

    apiVersion: gateway.networking.k8s.io/v1alpha2
    kind: Gateway
    metadata:
    name: my-gateway
    namespace: example-namespace
    spec:
    listeners:
    - name: http-1
    port: 80
    protocol: HTTP
    hostname: "example.com"
    - name: http-2
    port: 8080
    protocol: HTTP
    hostname: "example.com"

    Explanation: Changing the port of one of the listeners to 8080 ensures that each listener has a unique combination, preventing conflicts and making the configuration valid.

  2. Update the Hostname for One of the Listeners

    Alternatively, update the hostname of one of the listeners to ensure uniqueness.

    apiVersion: gateway.networking.k8s.io/v1alpha2
    kind: Gateway
    metadata:
    name: my-gateway
    namespace: example-namespace
    spec:
    listeners:
    - name: http-1
    port: 80
    protocol: HTTP
    hostname: "example.com"
    - name: http-2
    port: 80
    protocol: HTTP
    hostname: "another-example.com"

    Explanation: By changing the hostname of one of the listeners, the combination becomes unique, which resolves the conflict.