re: Data Persistence in Kubernetes | Kubernetes Volumes simply explained VIEW POST

re: Persistent volumes and deployments don't really go well together in my opinion. Why not just stick to statefulsets?

Yes, that's exactly right. You usually deploy DB applications with StatefulSet components and use volumes there. However the exceptions can be for example if you are just using a configuration file or a secret file for your application. Then you have a deployment with configMap or secret volumes. Or you can also have just 1 pod DB, with no replicas. In that case I would use deployment and not StatefulSet, because you need statefulSet if you need more than 1 pod replica of the DB.


Interesting. I use statefulsets even if there's a single replica 🤣. But using a deployment makes sense.

As for configmaps and secrets, Never had to deal with volumes directly. I didn't know you can store these on volumes. I was under the impression kubernetes stores them in etcd or something. We just need to mount them as volumes or env variables

code of conduct - report abuse