Skip to main content
logoTetrate Istio SubscriptionVersion: Next

TIS0301 - Multiple Gateways for Same Host-Port Combination

Multiple Gateway resources exist for the same host-port combination.

Recommendation: Avoid Duplicate Gateway Configurations

To prevent conflicts and ensure consistent behavior, remove duplicate Gateway entries or merge the definitions into a single resource for the same host-port combination.

Examples

  1. Two Gateway Objects Targeting the Same Host and Port

    First Gateway:

    apiVersion: networking.istio.io/v1beta1
    kind: Gateway
    metadata:
    name: gateway-1
    namespace: example-namespace
    spec:
    selector:
    istio: ingressgateway
    servers:
    - port:
    number: 80
    name: http
    protocol: HTTP
    hosts:
    - "example.com"

    Second Gateway:

    apiVersion: networking.istio.io/v1beta1
    kind: Gateway
    metadata:
    name: gateway-2
    namespace: example-namespace
    spec:
    selector:
    istio: ingressgateway
    servers:
    - port:
    number: 80
    name: http
    protocol: HTTP
    hosts:
    - "example.com"

    Explanation: Both Gateway resources define a server that listens on port 80 for the host example.com. Having multiple Gateway resources with the same host-port combination can lead to conflicts and undefined behavior, as Istio may not know which configuration to apply.

Recommendation

Remove duplicate gateway entries or merge the definitions into a single Gateway.

  1. Remove Duplicate Gateway Entry

    If one of the Gateway resources is redundant, remove it to avoid conflicts.

    kubectl delete gateway gateway-2 -n example-namespace
  2. Merge Gateway Definitions

    Alternatively, merge the definitions into a single Gateway to include all necessary configuration for the host-port combination.

    apiVersion: networking.istio.io/v1beta1
    kind: Gateway
    metadata:
    name: merged-gateway
    namespace: example-namespace
    spec:
    selector:
    istio: ingressgateway
    servers:
    - port:
    number: 80
    name: http
    protocol: HTTP
    hosts:
    - "example.com"