1

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
  • 171
  • 1
  • 6
  • Why not put the files into Google Cloud Storage? So you can run any number of replicas and don't have to care about local storage anymore. – tex Sep 20 '16 at 14:57

1 Answers1

1

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.

Community
  • 1
  • 1
CJ Cullen
  • 5,452
  • 1
  • 26
  • 34
  • I tried the GCS solution. I had to modify [the adapter](https://github.com/KnpLabs/Gaufrette/blob/master/src/Gaufrette/Adapter/GoogleCloudStorage.php) to make it work with newer google-api / guzzle version. Indeed, I have other dependencies working with a recent version of guzzle. I had poor performance when I tested locally but I think it's due to multiple API calls made by Gaufrette. Using this GCS option, are url of images supposed to directly point the GCS server ? Or is it supposed to go through my API first ? – Neko Sep 21 '16 at 13:01
  • About the Petsets, will it be the "official" recommended way to handle such a need ? – Neko Sep 21 '16 at 13:06
  • PetSets provide the primitives to manage distributed persistent storage, but its likely that something will be built on top of petSets to provide a simpler storage abstraction (e.g. [Cassandra](http://blog.kubernetes.io/2016/07/thousand-instances-of-cassandra-using-kubernetes-pet-set.html)). – CJ Cullen Sep 21 '16 at 15:03