Closed JohnnyCrazy closed 6 years ago
Thanks for your interest in Traefik !
The k8s annotations don't have the same name as labels: https://docs.traefik.io/v1.6/configuration/backends/kubernetes/#general-annotations
traefik.ingress.kubernetes.io/redirect-entry-point
traefik.ingress.kubernetes.io/redirect-permanent
traefik.ingress.kubernetes.io/redirect-regex
traefik.ingress.kubernetes.io/redirect-replacement
So I changed my annotations to the following:
traefik.frontend.redirect.permanent: "true"
traefik.frontend.redirect.regex: ^https://www.hello.mydomain.de/(.*)
traefik.ingress.kubernetes.io/redirect-permanent: "true"
traefik.ingress.kubernetes.io/redirect-replacement: https://hello.mydomain/$1
and the resulting config:
So the other naming kinda works too? I'm new to k8s, so I don't know why this is happening...
However, both naming conventions don't work for the permanent annotation, like the image shows it's still Temporary
Please use only the annotations prefixed by traefik.ingress.kubernetes.io/
.
Try traefik.ingress.kubernetes.io/redirect-permanent: true
We dedicate the issue tracker to bug reports and feature requests only.
If you have other questions, please go to the Traefik community Slack, thanks.
Closed by #3332.
Do you want to request a feature or report a bug?
Bug
What did you do?
I edited my ingress rule and added the following annotation:
What did you expect to see?
I expected to be redirected with a 301 status code. Also, I expected the frontend to show "Permanent" instead of "Temporary"
Also, if changing e.g
traefik.frontend.redirect.regex
, the frontend auto reloads the new config. This does not happen when changing thepermanent
rule.What did you see instead?
Instead, my redirect code stays at 302 and the frontend still shows "temporary"
Output of
traefik version
: (What version of Traefik are you using?)What is your environment & configuration (arguments, toml, provider, platform, ...)?
I'm running a Rancher 2.0 stack with the default nginx-ingress removed, and with treafik installed. Traefik routing is working fine, just this one rule is not working.
Startup for traefik:
Ingress Rule
If applicable, please paste the log output in DEBUG level (
--logLevel=DEBUG
switch)Not seeing any related output in the console, if needed anyway, I will deliver it subsequently 👍