How to retrieve / place data on Persistent Volumes on Google Kubernetes Engine

Currently we are working towards a Kubernetes solution that uses Google Kubernetes Engine (GKE). The Cuba app (JMIX) stores data in a location defined by a PersistentVolumeClaim.

While we can access the data by executing psql command directly in the pod that runs the application we want to make the volume available for easy retrieval of data and files. A suggestion from a colleague is to run some sort of server on the pod besides our app. He suggested WebDAV, FTP, HTTP and NFS.

Before I will set out to try and implement something I want to know if anybody has already done something like this. I have asked questions regarding Kubernetes and Cuba before but I know that not many people use the combination of GKE with Cuba (JMIX).

It’s not clear, sorry, what “data” do you mean?
The data in the PostgreSQL database?
Or file storage?
Or other temporary files created by the application?

Regarding Jmix deployment, Jmix application is deployed much like any other Spring Boot application, there isn’t a lot of specifics.

like @albudarov said, your issue is not specific to Cuba or Jmix at all.

Before deploying a solution on K8s (whatever provider, even a DIY cluster) you need to acquire the necessary knowledge to do it properly.
Kubernetes is not easy at all, even if it is marketed as such by some vendors/providers. My suggestion is to either study K8s with courses/books/certifications or hire a professional (at least some days/hours of consultancy) before trying to deploy something in production.

Having said so, some hints:

  • if possible, do not deploy a RDBMS on K8s, but use external managed services. Every major provider has one, for example Cloud SQL for Postgresql by Google. AWS, Azure and so on have theirs…
  • Either use a PV (persistent volume) with associated PVCs to store files or use an external storage. Even for files, I suggest to use an external blob storage service, like Google Cloud Storage. It is S3 compatible, like every other major blob storage service, so you can use the S3 add-on to read/store files on it.
  • In general, try to deploy “stateless” pods on K8s, and externalize every state (DB, files, and so on). Your life will be easier…


Thank you Paolo for your suggestions,

You are right that K8s is not easy at all, something we have discovered now that we are migrating our current solution to Google Cloud. It is certainly making us reconsider our goals. That said, we have come a long way and we want to complete this PoC. Some of the hints that you made were already considered.

Migrating data back and forth between cloud vendors and our current solution has always been the biggest obstacle, a ball we have willfuly been kicking forward. Considering there are an abudance of options my question was an attempt at discovering what other developers of CUBA and JMIX had done.

I hope others may pitch in with their experience but right now we will continue work roughly along the lines that you have suggested.