Skip to content

Shared Gateway


Deploy a second workload and a second route associated to the same gateway

kubectl apply -f apps/customers.yaml -f apps/web-frontend.yaml

Configure the route

---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: web-frontend
spec:
  hostnames:
  - customers-frontend.esuez.org
  parentRefs:
  - name: eg
  rules:
  - backendRefs:
    - name: web-frontend
      port: 80
kubectl apply -f shared-gw/web-frontend-route.yaml

✅ Verify

After the DNS entry is created, verify that the route is reachable:

curl http://customers-frontend.esuez.org/
curl http://customers-frontend.esuez.org/ --resolve customers-frontend.esuez.org:80:$GATEWAY_IP

Inspect route configuration

egctl config envoy-proxy route -n envoy-gateway-system \
  -l gateway.envoyproxy.io/owning-gateway-name=eg \
  -l gateway.envoyproxy.io/owning-gateway-namespace=default \
  -o yaml | bat -l yaml

Here is a slightly sanitized copy of the captured output:

envoy-gateway-system:
  envoy-default-eg-e41e7b31-59b4dd766f-sf78k:
    dynamicRouteConfigs:
    - routeConfig:
        name: default/eg/http
        virtualHosts:
        - domains:
          - httpbin.esuez.org
          name: default/eg/http/httpbin_esuez_org
          routes:
          - match:
              prefix: /
            name: httproute/default/httpbin/rule/0/match/0/httpbin_esuez_org
            route:
              cluster: httproute/default/httpbin/rule/0
        - domains:
          - customers-frontend.esuez.org
          name: default/eg/http/customers-frontend_esuez_org
          routes:
          - match:
              prefix: /
            name: httproute/default/web-frontend/rule/0/match/0/customers-frontend_esuez_org
            route:
              cluster: httproute/default/web-frontend/rule/0