I use nomad + consul so I don’t know if I should ask my question here or in the consul part.
I use haproxy as an input proxy for an app and I have an http web application behind the haproxy. I would like to do canary deployment with nomad on this app.
Via haproxy I would like to route the request to the canary job (when there is a special http cookie in the request). My concern is that I can’t point my haproxy backend to canary servers only.
Is it possible? obviously consul does not create a particular dns record for the canary version.
How do you test the canary deployment with haproxy in front?
Hi Mickael. You’ll want to use Layer7 traffic splitting/routing to achieve this. All the major reverse proxies can accomplish this, including HAProxy. In short, you’ll want to leverage consul tags to differentiate which service is the live service and which one is the canary. Then you’ll need to edit the HAproxy config with Nomad templates to ensure HAproxy and Consul are on the same page. I found this blog that could potentially get you on the right path: https://danielparker.me/haproxy/blue-green/deployments/canary/nomad/simple-blue-green-haproxy/
Another option is to use consul service mesh and deploy a Layer 7 router.