gateway icon indicating copy to clipboard operation
gateway copied to clipboard

Add support for multiple gateways

Open NomadXD opened this issue 3 years ago • 2 comments

Description: I want to have several gateways(envoy proxies) under one envoy gateway and use parentRef in the HttpRoute to decide on which gateway the HttpRoute should get deployed. I tried the above scenario with the v0.2.0-rc1 and couldn't make it work.

Steps I followed:

  1. Followed the quick start guide and deployed 1 EG, 1 gateway, httpbin and 1 HttpRoute and verified the functionality. It works as expected.
  2. Deployed a second gateway using the following CRD using kubectl apply -f gateway.yaml.
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: Gateway
metadata:
  name: egtest
spec:
  gatewayClassName: eg
  listeners:
    - name: http
      protocol: HTTP
      port: 8080

I'm getting the following error in envoy gateway container logs.

2022-09-13T07:05:50.939Z	ERROR	runner/runner.go:95	unable to validate infra ir, skipped sending it	{"runner": "gateway-api", "error": "listener ports field required", "errorCauses": [{"error": "listener ports field required", "errorCauses": [{"error": "listener ports field required"}]}]}
github.com/envoyproxy/gateway/internal/gatewayapi/runner.(*Runner).subscribeAndTranslate
	/home/runner/work/gateway/gateway/internal/gatewayapi/runner/runner.go:95

It says listener ports field required but I have provided it as you can see here.

NomadXD avatar Sep 13 '22 07:09 NomadXD

@NomadXD your 2nd Gateway conflicts with the example Gateway. Envoy Gateway merges multiple Gateways instead of managing a separate proxy infra, e.g. Envoy, per Gateway. Listeners must have a unique hostname to get merged. When hostname is unspecified, all * hostnames are used. Please see the Gateway spec for additional details. With that said, EG should provide a better error message. Additionally, I have yet to test multiple Gateways, so let me do that and report back.

danehans avatar Sep 13 '22 15:09 danehans

Note, this is similar to or maybe identical to #349 -- multiple Gateways, each with Listeners with identical hosts/ports/protocols.

skriss avatar Sep 13 '22 22:09 skriss

fixed with https://github.com/envoyproxy/gateway/pull/404

arkodg avatar Sep 28 '22 04:09 arkodg