@jakubhajek
I found this link here which seems to make sense, however even after adding the annotation it still doesn't work for me. Note the new annotation in the IngressRoute ....perhaps it only works for Ingress resource?
How to configure middleware with kubernetes-ingress? (middleware "xyz" does not exist)
Here's my config.
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
annotations:
traefik.ingress.kubernetes.io/router.middlewares: b2b-video-service.b2b-watch@kubernetescrd
kubernetes.io/ingress.class: traefik
name: watch-service
spec:
entryPoints: []
routes:
- kind: Rule
match: Host(`video-service.b2b`) && PathPrefix(`/watch`)
middlewares:
- name: video-service.b2b-watch
namespace: b2b
priority: 0
services:
- kind: Service
name: video-service
namespace: b2b
port: 8080
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: video-service.b2b-watch
namespace: b2b
spec:
replacePathRegex:
regex: ^/watch(.*)
replacement: $1