Doul
Doul

Reputation: 71

How to Canary rollout between two namespace, using Treafik v2

I want to implement Canary release between two namespace : ns-A (old version), ns-B (new version). My cluster have Traefik v2 and it's not possible to install an another controller, two bad because I found solution to do it with istio and nginx.

Do you know if it's possible to do it with Traefik?

I tried with IngressRoute and TraefikService with weight (Weighted Round Robin describe in the doc, even if it seems to be for services in the same namespace).

Result : my requests are well routed btween the two namespace but the different weight I test does nothing on distribution : cf image where the weight were, for ns-A and ns-B respectively, 80-20, then 20-80, then 10-90, then 1-90.

Traffic distribution (ns-A in purple, ns-B in pink) : Traffic distribution (ns-A in purple, ns-B in pink)

My test is, in the two namespace :

One of the yaml :

kind: Service
apiVersion: v1
metadata:
  name: server
  labels:
    app: main-server
spec:
  ports:
    - name: http-server
      port: 3333
      targetPort: 3333
---

apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
  name: wrr1

spec:
  weighted:
    services:
      - name: server
        port: 3333
        weight: 20
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: server-ingressroute

spec:
  routes:
  - kind: Rule
    match: Host(`testapp.intra`) && PathPrefix(`/`)
    services:
    - name: wrr1
      kind: TraefikService

Have you any idea how Traefik (or ingress) does the traffic distribution showed in the image? Do you know how I can control it?

Thanks in advance

Upvotes: 1

Views: 119

Answers (0)

Related Questions