I see in the docs how do do this for pods, but I want to use a replication controller to manage my pods, ensuring that there is always one up at all times.
How can I define a replication controller where the pod being run has a persistent volume?
How is this related to Kubernetes persistentVolumes and persistentVolumeClaims?
Using a persistent volume in a Replication Controller works great for shared storage. You include a persistentVolumeClaim in the RC's pod template. Each pod will use the same claim, which means it's shared storage. This also works for read-only access in gcloud if your Replica count > 1.
If you wanted distinct volumes per pod, you currently have to create many RCs with Replicas=1 and with distinct persistentVolumeClaims.
We're working out a design for scaling storage through an RC where each pod gets its own volume instead of sharing the same claim.
Please note that persistent volumes are linked to a node, they are not shared throughout the cluster. That is probably the reason you didn't find information about the replication controller with persistent volumes. Because replication controllers are not limited to running one node.
If you are using the Google Cloud, look into GCEPersistentVolume https://github.com/GoogleCloudPlatform/kubernetes/tree/master/docs/user-guide/persistent-volumes
Another option, though not production ready is: https://clusterhq.com/2015/04/24/data-migration-kubernetes-flocker/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With