0

I have a service that need to receive any request made on

  • / (exact match)
  • /aaa (path prefix)

Other paths will be sent to a different service.

Using traefik.frontend.rule.type: PathPrefix would work for the the second rule only and traefik.frontend.rule.type: Path for the first one only.

What is the recommended way to achieve this? Two distinct ingresses?

ITChap
  • 4,057
  • 1
  • 21
  • 46

1 Answers1

2

There are two options: As you suggested yourself, you can use two ingress objects. traefik will merge the definitions accordingly. For the Simple "/" route I assume that you want to do something like a redirect or load a browser client. You can use this annotation

traefik.ingress.kubernetes.io/app-root: "/aaa/index.html"

to redirect from the "/" route to a route that matches your pathprefixstrip.

Thomas
  • 11,272
  • 2
  • 24
  • 40