How to manage file uploads with GKE?

9/20/2016

I'm trying to run an api (based on Symfony) with kubernetes thanks to Google Container Engine (GKE). This API also allow user to store and download files, which are supposed to be saved somewhere.

I tried to run it with 1 replica, and noticed a downtime of the service during the creation of the new container. It looks like at least 2 replicas are needed to avoid downtime.

Taking that into consideration, I'm interested about these options :

  • A volume based on Google Persistent Disk. Would this mean that all my replicas would be on the same node ? (ReadWriteOnce access mode). If so, in case of a node failure, my service would not be available.
  • A volume based on Flocker (Backend Persistent Disk). What is the recommended way to install it on GKE ?

Is there another interesting option ? What would you recommend ?

-- Neko
google-kubernetes-engine
kubernetes
symfony

1 Answer

9/20/2016

Using GCS (like tex mentioned) is probably the simplest solution (and will be very fast from a GKE cluster). Here is an answer that may help.

If you have a specific need for local persistent storage, you can use Google Persistent Disks, but they can only be mounted as writable in one place.

Petsets (currently alpha) will provide better support for distributed persistent in-cluster storage, so you can also look into that if GCS doesn't work for you.

-- CJ Cullen
Source: StackOverflow