emissary-ingress / emissary

open source Kubernetes-native API gateway for microservices built on the Envoy Proxy
https://www.getambassador.io
Apache License 2.0
4.32k stars 685 forks source link

Routing with prefix not working #5610

Closed tobiwanobi closed 3 months ago

tobiwanobi commented 3 months ago

Describe the bug When having a single domain and 2 Mappings to this domain with different prefixes defined, the routing does not work correctly. Some request work, some not. When I delete one part of this setup the other part works perfectly fine, only when I apply both apps with their corresponding Mappings it does not work.

To Reproduce

Install Emissary using the latest Helm chart in your cluster, create a Host and then create 2 deployments, 2 services, ... and then 2 Mappings with the same hostname but different prefix one routing to to service A and the other to B. On my end its not working.

Expected behavior

Routing should work so I should receive an answer of my application all the time, not only sometimes.

Versions (please complete the following information): latest Version and kubernetes 1.28 on a local environment. Everything is working well.

Additional context Here are my yaml files to define my application using kustomize:

base.yaml

apiVersion: getambassador.io/v3alpha1 kind: Mapping metadata: name: demomodernapplicationdeployment-mapping namespace: demomodernapplicationdeployment spec: hostname: "demomodernapplicationdeployment.mydomain.com" prefix: / service: demomodernapplicationdeployment-service.demomodernapplicationdeployment:80 timeout_ms: 100000


overlays/lko/kustomization.yaml

resources:

patches:

nameSuffix: -lko

images:


overlays/lko/mapping-patch.yaml

apiVersion: getambassador.io/v3alpha1 kind: Mapping metadata: name: demomodernapplicationdeployment-mapping namespace: demomodernapplicationdeployment annotations: patch: "true" spec: prefix: /lko/ rewrite: "/" service: demomodernapplicationdeployment-service-lko.demomodernapplicationdeployment:80


overlays/tsl/kustomization.yaml

resources:

patches:

nameSuffix: -tsl

images:


overlays/tsl/mapping-patch.yaml

apiVersion: getambassador.io/v3alpha1 kind: Mapping metadata: name: demomodernapplicationdeployment-mapping namespace: demomodernapplicationdeployment annotations: patch: "true" spec: prefix: /tsl/ rewrite: "/" service: demomodernapplicationdeployment-service-tsl.demomodernapplicationdeployment:80

As mentioned, if I only apply one of the 2 overlays it works perfectly fine, only if I use both its not working so the issue cannot be related with my application.

tobiwanobi commented 3 months ago

sorry my bad, was just a kustomization misconfiguration from my end, works perfectly fine now!