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 683 forks source link

Emissary creating duplicate mapping routes in ir.json and econf.json #5702

Open sekar-saravanan opened 1 week ago

sekar-saravanan commented 1 week ago

Describe the bug Emissary creating duplicate mapping routes in ir.json and econf.json while adding weight for canary release

To Reproduce Steps to reproduce the behavior:

  1. Create mapping for original and canary release with weight. It will recreate the ir.json and econf.json. (No duplicates found)
  2. Do perform update on any other existing mapping. It will recreate the ir.json and econf.json. (Now we can see the duplicate routes for above created mapping)

Expected behavior Emissary should not create duplicate routes in ir.json and econf.json for canary release

Versions (please complete the following information):

Additional context Have attached the deployment.yaml, service.yaml, mappings.yaml, host.yaml and ir.json and econf.json with duplicate routes.

Duplicate routes presents under, ir.json: -> groups -> mappings econf.json: -> listeners -> filter_chains -> filters -> route_config -> virtual_hosts -> routes docs.zip

What is the Impact ? No impacts on traffic.

Other Imapcts:

juanjoku commented 6 days ago

Hello, It is indicated here that it fixes the bug of "duplicate mappings" when there are several analog mappings with different weights. But... would the same problem occur when, for example, there are several analog mappings with different prededence?

In other words, is it intended to fix something more generic than weights?

sekar-saravanan commented 5 days ago

@juanjoku Thanks for your response. I have tried with precedence configuration also. When setting different precedences for 2 mappings (with same host and path) with different weights (for canary purpose), then 100% weight applied for both mappings in econf.json/envoy.json. so traffic always sent to mapping with higher precedence.

sekar-saravanan commented 6 hours ago

@juanjoku added fix for this bug. can you please review this PR https://github.com/emissary-ingress/emissary/pull/5705 ?

sekar-saravanan commented 6 hours ago

@juanjoku added fix for this bug. can you please review this PR https://github.com/emissary-ingress/emissary/pull/5705 ?