thomseddon / traefik-forward-auth

Minimal forward authentication service that provides Google/OpenID oauth based login and authentication for the traefik reverse proxy
MIT License
2.16k stars 409 forks source link

Middleware not working - had to use long service DNS FQDN with namespace in kubernetes #291

Open Startouf opened 2 years ago

Startouf commented 2 years ago

I have tried following the various tutorials that used

forwardAuth:
    address: http://traefik-forward-auth:4181

But after struggling for a long time, and this syntax was not working, I figured out I needed to use the proper kubernetes DNS with the namespace

So this becomes

forwardAuth:
    address: http://traefik-forward-auth.[namespace].svc.cluster.local:4181

I believe this should be the recommended practice, what do you think ?

tyriis commented 2 years ago

The first example only works when you are in the same namespace. Second will always work.

uatec commented 2 years ago

Moreover, the first example only works when traefik and the traefik-forward-auth service are in the same namespace. Traefik does not respect the namespace of the middleware when resolving the address.

NishikaDeSilva commented 1 year ago

I tried with both address: http://traefik-forward-auth:4181 and address: http://traefik-forward-auth.[namespace].svc.cluster.local:4181 Nothing works for me. Any suggestions? I have traefik and forward-auth in the same namespace.