1. Proposed title of this feature request => Scale pod and the volume attached to the pod 3. What is the nature and description of the request? => Imagine a pod with a pv backed by a replication controller, and when scaling the pod to 2, would it be possible that the new pod will have a new volume? I've seen in the templates (i.e.- the mysql with permanent storage), it creates the claim and then attach the volume using the claim previously created, but if I try to scale the rc, the new pod also tries to use the same volume (which fails because it is not multiwrite enabled). Any clues? I've seen this https://github.com/openshift/origin/issues/4211 that talks about a "PersistentVolumeClaimTemplate on the RC side-by-side with the PodTemplate" and some folk asking in stackoverflow http://stackoverflow.com/questions/33313199/is-there-any-way-that-can-make-each-pod-gets-its-own-volume-in-rc-template and nothing else A simple use case will be the one commented in the upstream issue, when a user wants to create a database cluster where every database node has its own storage. It can start with a single pod and a persistent volume attached to the pod and when scaling to >1 pod, a new pod with a proper new volume needs to be created, otherwise, the new pod will try to use the same volume and bad things can happen (data corruption) The current implementation for PVs and RCs means that all pod replicas created in the RC will share the same claim name. This works well for shared storage, but does not work if you want a distinct volume per pod. The PetSet proposal being discussed upstream handles distinct volumes per pod. https://github.com/kubernetes/kubernetes/pull/18016 Ways of making an RC give distinct volumes to pods seems to be under discussion as per the mailing list. It's not a technical issue/problem, but a lack-of-good-requirements problem. Mailing list discussion - http://post-office.corp.redhat.com/archives/openshift-sme/2016-January/msg00438.html 7. Is there already an existing RFE upstream or in Red Hat Bugzilla? => Related - https://github.com/kubernetes/kubernetes/pull/18016 https://github.com/openshift/origin/issues/4211 10. List any affected packages or components. => Master, Node, Kubernetes, Replication Controller
Re-assigning to Brad as this is an RFE.
Miheer, we are working to address this issue. I do want to point though that if you use HostPath as your volume type in your RC definition, then you would be able to get the functionality you seek. However, this is usually only a solution that is available on-premise as most Cloud Providers do not provide enough local storage capacity for this to be an attractive alternative. For a network storage based solution (as opposed to HostPath, which is local storage), the current community strategy is looking to address this is via the PetSet proposal which you refer to and that work is in progress.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:0066