Skip all /internal routes

I want to skip all traffic of PathPrefix(/internal) ...

  • Is that possible?
  • I want to configure only one IngressRoute for the hole cluster
  • I have something in mind like that ... ( but it dosen't work :frowning: )
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: internal-skip
spec:
  entryPoints:
    - websecure
  routes:
    - match: PathPrefix(`/internal`)
      kind: Rule
      middlewares:
        - name: internal-skip
      priority: 1000
  tls: {}
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: internal-skip
spec:
  ipWhiteList:
    sourceRange:
      - 127.0.0.1/32

Hint: for a dedicated service it works fine

Hello @jwausle,

What do you want to achieve? What do you mean by skipping all the traffic?

If you want to route all traffic except the one on /internal to a given route, you can do !PathPrefix(`/internal`).

2 Likes

@tommoulard good idea.

  • Sometimes I'm blind for simple solutions
  • I will try it out.

I want to achieve as You right mention ...

- match: PathPrefix(`/path`) && !PathPrefix(`/path/internal`)
1 Like