jcmoraisjr / haproxy-ingress

HAProxy Ingress
https://haproxy-ingress.github.io
Apache License 2.0
1.04k stars 269 forks source link

Url Parameter based routing #1159

Open erulabs opened 3 months ago

erulabs commented 3 months ago

What are you trying to do

I want to route traffic to a particular service based on an optional URL parameter. Without the parameter, it should match either the default backend or any other matching backend.

What HAProxy Ingress should do or how it should behave differently

HAPRoxy ingress should allow an annotation on a service or ingress level that adds a frontend acl like:

acl route_to_urlparam_gated_service urlp(myFlag) -m found
use_backend urlparam_gated_service if route_to_urlparam_gated_service

Unless I'm missing something, this seems to be currently only possible by adding a global frontend config snippet and knowing the generated name of the backend ahead of time. This isn't so bad, but it does mean if the related ingress is deleted, haproxy will stop reloading as the backend referenced in the global config will no longer exist.

This is the only part of migrating from plain haproxy to haproxy-ingress that has been a pain for me so far. Thanks so much for your efforts -- looking forward to contributing when I can!

haproxytech's ingress controller supports haproxy.org/route-acl (docs) which supports this functionality.