1 Answers
Hello Andrei,
Maybe I can clarify a bit from my own perspective.
Here you are basically asking two questions:
1. Isn’t it better/easier to use a managed DB service instead of running your DB in kubernetes?
2. Can a new pod claim an existing orphaned/unclaimed volume (if the reclaim policy is not delete)?
Here are my answers:
1. Everything solution in IT comes with a compromise. Yes, running your DB in a managed DB service is probably EASIER, but that doesn’t mean that it’s always possible/best solution.
What if you already have a k8s cluster with spare nodes and you don’t want to spend additional charges on a managed db service when you can run your db for free.
What if you don’t want to setup networking between your cluster and a managed db.
What if you are not on the cloud and you are running kubernetes in your DC and have no access to cloud.
2. The answer to this question is a DEFINITE YES. That’s the whole point of separating volumes from pods/processes. Think of volumes as your hard disk on your pc and pods as a process on your desktop. You can start/terminate/fail a process, but the disk is there and the process knows where to find what it needs each time. Pods can die for a various reason, but k8s control plane can bring it back on and as soon as it comes back on, it can attempt to reclaim the volume, again depending on the arch of your service/deployment.