I am working on a feature of an application where we need to implement a maintenance mode, that can be toggled by admins of the platform. My main concern is the backend, specifically how to handle maintenance mode in an API Gateway that has multiple pods.
Here’s the approach I am considering:
-
During the startup of the API Gateway application, each pod will request a service that contains information about whether the maintenance mode is enabled or not.
-
Based on the response, each pod will set filters to block or allow requests accordingly.
-
To ensure consistency across all pods, whenever the maintenance mode is toggled, an event will be sent via Kafka. This event will be consumed by each pod, which will then update their filters in real-time.
The idea is to have a configuration service that holds the state of the maintenance mode. When the state changes, a Kafka event is published, and each pod listens to this event to update its filters immediately.
Does this approach make sense, or are there better ways to solve this problem? How do others handle similar issues in a multi-pod API Gateway environment?
Thanks in advance for your insights!