I have a Golang application running in Kubernetes which needs to persist a single string value outside of it's memory. In other words, if the application is redeployed or the pod is restarted - the value is not lost. I also need to be able to read and write this from golang regularly.
What is a good way to do this?
So far I've thought about: 1. ConfigMap: Would this be considered misuse to utilize a config map, and are they even persistent? 2. PersistentVolume: This seems appropriate, but can I store a single value or a file with this, rather than setting up an entire database?
Thank you!
In Kubernetes, you have the following options to store data outside the POD (or actually to share data between PODs).
I'm not sure about your exact use case, but I'd start from a 3-rd party software. They are very simple to deploy with Helm Chart of Operators. Another option is Persistent Volume. ConfigMap/Secret, I'd treat it as last resort.