I have an event-sourced CQRS architecture hosted in kubernetes. I have a single writer (the "denormalizer service") that listens to events and writes the denormalized views to a datastore. These views are then served by a separate view service. When the denormalizer image is updated through a deployment with new projections it replays all events from the beginning and writes the new views to a different datastore.
So I need 2 instances of denormalizer, one with the old code, and another replaying the events through the new code. When the new code is finished replaying I need to: 1) signal to the view service to switch to the newly written datastore and then, 2) bring down the old denormalizer deployment as it is no longer required.
Problem is, (to my limited knowledge) kubernetes seems ill-equipped to deal with this scenario.
Any idea how I would do something like this?