Hi. I wanted to filter using IP, and I tried to use the annotation
ingress.kubernetes.io/whitelist-source-range: 188.8.131.52/32 using Traefik2 on K3S but it doesn't seem to have any effect.
traefik.ingress.kubernetes.io/router.middlewares: namespacename-middlewarename@kubernetescrd works.
I just need to have the corresponding ip filtering middleware:
I can deal with the middleware but I'm wondering whether the first generic annotation is supposed to work, because I would rather use it. It's more generic and would work on many kubernetes installations.
Just wanted to post here saying that I'm doing a similar journey trying to get whitelisting to work with the default k3s deployment using traefik
Hello @fungiboletus @icsy7867
In order to correctly use middleware with Kubernetes Ingress the following annotation has to be added:
The list of available annotation is available here: Kubernetes Ingress - Traefik
While assigning middleware please be aware of the naming convention that depends on the provider namespace.
Technically speaking the general rule is following:
For Kubernetes the naming convention is following:
I manage to use the traefik middlewares correctly, but I would rather avoid them because they are specific to traefik compared to the
ingress.kubernetes.io/whitelist-source-range annotation that works on many ingress.