Traefik API to live configure plugins?


First of all, thank you very much for the excellent work on Traefik!

I would like to use Traefik as an API manager for implementing IP restriction. However, my IP list will change frequently, so I plan to automate the updating of this list. I found this feature in Traefik:

I would like to be able to change the IP list while Traefik and all the containers of my application are running. Do you know if it's possible to achieve this, perhaps through a Traefik's back office API?

For example, a similar capability is available in the API manager Apisix:

Maybe a such feature is possible in Traefik?

Thank you in advance for your assistance!

Traefik has no programmable API, you can only read config in real-time from the API.

AFAIK you have 4 options:

  1. middleware is dynamic config, you can just update the file when using providers.file and watch
  2. you can read dynamic config in intervals via http from another source using providers.http
  3. you could use ForwardAuth middleware and have a service checking the IPs and return 200 or an error
  4. build your own Traefik plugin with go-lang
1 Like