Use Mirroring and Canary testing in Kubernetes

Hi,

How can I use a canary or mirroring IngressRoute by creating a weight-balanced traefik "service" on two kube services ?

I follow the documentation and this blog : https://blog.containo.us/traefik-2-0-6531ec5196c2

but I don't find how to create a dynamic

http:
  services:
    canary-api:
      weighted:
        services:
        - name: my-api-v1
          weight: 3
        - name: my-api-v2
          weight: 1

directly im my kube IngressRoute template ?

In my configuration, each user have a namespace, and each user want to create its own canary route on itw own service with its own weight...

Thanks for help

Hello,

Take a look here: https://github.com/containous/traefik/pull/5711

Thanks for informations.

I 've read new documentation and installed new CRDs

But I always have a problem when I try to deploy Traefik service and Ingress route

for exemple :
Deployment : OK : 2 simple whoami apps (one version 1.3, one version 1.4)
Kubernetes Services : OK (1 service for whoami-1.3, one service for whoami-1.4)

TraefikService :

apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
  name: canary
  namespace: default
spec:
  weighted:
    services:
      - kind: Service
        name: whoami-1-3
        port: 80
        weight: 8
      - kind: Service
        name: whoami-1-4
        port: 80
        weight: 2

IngressRoute :

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: canary
  namespace: default
spec:
  entryPoints:
    - web
  routes:
  - match: Host(`whoami.mydomain.org`) && PathPrefix(`/canary`)
    kind: Rule
    services:
    - name: canary
      namespace: default
      kind: TraefikService

but Traefik can't suceed to create IngressRoute beacause of this error :

level=error msg="Cannot create service: service not found default/canary" servicePort=0 ingress=canary namespace=default serviceName=canary providerName=kubernetescrd

Any ideas ?

Thanks for help

Sincerly

This is a still open PR.