I have the following scenario:
- A StatefulSet with 1 replica
- Update the template section and scale it in the same operation using helm as application manager
- The order of operation is the following:
- Scaling to 3
- Update the replica with name 0
Because I cannot control to first update and after that scale, I am losing data because there is a specific logic in the new statefulset template.
Is there a way to control the ordering of those operations?
The service in question is Redis, we are trying to get from standalone mode (1 replica) to replication(HA) without losing data.
2
Answers
For the moment I resolved the problem using a helm pre-install job that is basically scaling the sts to zero, after that helm is coming with the update.
I am not Redis expert, but I think that solution below should help you.
I would try to install another Redis HA instance (B) next to the existing one (A), taking as a data source for B a snapshot of A’s PV. This could to avoid losing your data. For more information you can read more about volume snapshots.
See also this related problem.