Web / Traefik Interview questions
How does Traefik implement weighted round robin for canary deployments?
A canary rollout is expressed as a weighted service, a service made up of multiple underlying services (say, app-stable and app-canary) each given a numeric weight that determines its share of traffic.
http: services: app-canary-split: weighted: services: - name: app-stable weight: 90 - name: app-canary weight: 10
Traefik distributes requests across the two proportionally to those weights, so roughly 10% of traffic reaches the canary version while the rest continues to the stable one, and a router simply points at the weighted service as if it were any other.
Because the weights live in dynamic configuration, ramping a canary from 10% to 50% to 100% is just a matter of updating the weight values, without touching routers, entrypoints, or the underlying deployments themselves.
More Related questions...