Hello,
we are currently switching from Traefik v1 to v2 in our k8s.
We widely use the feature of path prefix stripping with the ingress annotation "traefik.frontend.rule.type: PathPrefixStrip" which is removed in v2.
As far as is understand Middlewares are in the v2 necessary to do path prefix stripping. Our problem is that we do not have cluster admin rights and therefore cannot deploy custom ressource definitions.
We tried something like this in the traefik.toml, but it does not work as expected. Do we miss something here?
Hi @moutoum ,
thanks for the hint. I changed my config acordingly, but it still does not work.
I took a look into the dashboard and the routes and middlewares seem not to be instantiated.
The section HTTP Middlewares show only two entries related to the dashboard.
In the section routing there are only the generated routes from my ingresses which shows an error like: middleware "file-service1@kubernatescrd" does not exist
I have referenced the configuration in the ingress with this annotation: traefik.ingress.kubernetes.io/router.middlewares: file-service1@kubernatescrd
like described in your documentation.
Is there also a typo in the naming? I'm not shure if I correctly understand the concatenation of the name.
thank you for the info! I couldnt find this in the documentation.
But if i look into the dashboard it still says ERRORS middleware "service1@file" does not exist. Do I have to configure something else to get the middleware from the config toml working?
If you can not apply that middleware it has not been created by Traefik. I would suggest having a look at the log files, especially while Traefik is starting, see the first lines that should be a lot of crucial information about what has been loaded and if there are errors you should see them.