We have realised the mistake of using a Deployment with a PVC for our stateful app instead of going with Statefulset. I was wondering how the upgrade would work. How can I point to the old data with the new statefulset ? I am guessing that the old PVC cannot be used by the volumeClaimTemplate ? I have not found anything via Google with my search abilities.
Did anyone else go through this phase ? If you have, what was the process you followed ?
Thanks.
Adding some more details regarding the setup.
- Currently it is a simple deployment with no replicas. Just 1 deployment and 1 pod.
- PV+PVC is used to have a persistent volume mounted where we write all of the data.
- On Helm upgrade, we have a pre-upgrade hook added which mounts the same PV+PVC into the upgrade container and upgrades the data (Modifying XML files etc)
It is simple, but the helm chart is bit too complicated with lots of other noise, but basically the application can be considered as simple as above.
Now, what I am looking for in my next upgrade is a process where I can make the above deployment as a statefulset and also have all the data still usable by the Pod.