Web / Traefik Interview questions
How does Traefik's hot-reload mechanism detect and apply dynamic configuration changes?
Each enabled provider runs its own watch loop appropriate to its source: the Docker provider listens to the Docker event stream, the Kubernetes provider watches the API server for object changes, and the File provider uses filesystem notifications when watch is enabled.
Whenever a provider detects a change, it recomputes its slice of the dynamic configuration and pushes it into Traefik's internal configuration aggregator, which merges updates from every active provider into one unified model.
Traefik then builds a new internal routing table from that merged configuration and atomically swaps it in for the one currently serving traffic, so in-flight requests continue to complete against the old table while new requests immediately see the updated one.
Because this swap happens without closing the listening sockets or restarting the process, hot reloads are effectively invisible to clients, aside from new routes becoming available or old ones disappearing at the moment of the swap.
More Related questions...