FWIW, I recently ran into a similar issue, and the way I handled it was to have each of the pods mount an NFS shared file system as a PV (AWS EFS, in my case) and have each pod write its output into a directory on the NFS share. The only issue then is just to make sure that each pod writes it's output to a file that has a unique name (e.g., has the pod name or ID in the file name) so that the pods don't overwrite each other's data.

HTH,

DR

On 9/6/18 4:33 PM, 'Tim Hockin' via Kubernetes user discussion and Q&A wrote:
You have to understand what you are asking for.  You're saying "this
data is important and needs to be preserved beyond any one pod (a
persistent volume)" but you're also saying "the pods have no identity
because they can scale horizontally".  These are mutually incompatible
statements.

You really want a shared storage API, not volumes...
On Thu, Sep 6, 2018 at 1:08 PM Naseem Ullah <nas...@transit.app> wrote:

I see I see.. what about autoscaling statefulsets with an HPA?

On Sep 6, 2018, at 4:06 PM, 'Tim Hockin' via Kubernetes user discussion and Q&A 
<kubernetes-users@googlegroups.com> wrote:

Deployments and PersistentVolumes are generally not a good
combination.  This is what StatefulSets are for.

There's work happening to allow creation of a volume from a snapshot,
but it's only Alpha in the next release.
On Thu, Sep 6, 2018 at 1:03 PM Naseem Ullah <nas...@transit.app> wrote:

Hello,

I have a similar use case to Montassar.

Although I could use emptyDirs, each newly spun pod takes 2-3 minutes to 
download required data(pod does something similar to git-sync). If volumes 
could be prepopulated when a new pod is spun it will simply sync the diff, 
which will drastically reduce startup readiness time.

Any suggestions? Now I have a tradeoff between creating a static number of 
replicas and creating same number of PVCs , or using HPA but emptyDir volume 
which increases startup time for the pod.

Thanks,
Naseem

On Thursday, January 5, 2017 at 6:07:42 PM UTC-5, Montassar Dridi wrote:

Hello!!

I'm using Kubernetes deployment with persistent volume to run my application, 
but when I try to add more replicas or autoscale, all the new pods try to 
connect to the same volume.
How can I simultaneously auto create new volumes for each new pod., like 
statefulsets(petsets) are able to do it.

--
You received this message because you are subscribed to the Google Groups "Kubernetes 
user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to kubernetes-users+unsubscr...@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Kubernetes 
user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to kubernetes-users+unsubscr...@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Kubernetes 
user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to kubernetes-users+unsubscr...@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Kubernetes 
user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to kubernetes-users+unsubscr...@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.
  • Re: [kubernetes-us... Naseem Ullah
    • Re: [kubernet... 'Tim Hockin' via Kubernetes user discussion and Q&A
      • Re: [kube... Naseem Ullah
        • Re: [... 'Jing Xu' via Kubernetes user discussion and Q&A
          • R... Naseem Ullah
            • ... 'Tim Hockin' via Kubernetes user discussion and Q&A
            • ... Naseem Ullah
        • Re: [... 'Tim Hockin' via Kubernetes user discussion and Q&A
      • Re: [kube... David Rosenstrauch
        • Re: [... 'Tim Hockin' via Kubernetes user discussion and Q&A
          • R... David Rosenstrauch
        • Re: [... Naseem Ullah

Reply via email to