Mark Route as Unavailable

Looking through the traefik v2 CRD's I do not see an obvious way to mark a service as unavailable.

The idea is to build a traefik aware kubernetes operator that will modify the traefik state to return a custom 503 page for example during database migrations.

Right now one obvious solution seems to be doing a middleware redirect to a public maintenance page


Hello @cliedeman,

Another option would be to use readiness gates (

To flag your pods as not ready. This will remove them from the service endpoints, and Traefik will return a 503.

Thank you for the reply

As usual Kubernetes has already solved this problem. Or at least given us some tools.

But I don't think this quite works as a general 503 error page/service unavailable would be slightly different to a Maintenance page

Hello @cliedeman,

You are correct, you may want to combine the two, but the gates would allow asynchronous changes.

You could update the CRD middleware to show the maintenance error page at your leisure, and then use the gates to trigger the page during your maintenance period.

That sounds like a solid approach. Thank you