2

I am trying to persist the data of my pods on GKE (like a docker volume).

I came across two methods and I don't know which is the go to method.

  1. Using jcsFuse.
  2. Using persistent volume and persistent volume claims.

Which is the method that would allow me to mount my pods to google cloud storage?

Thank you for the help.

Wytrzymały Wiktor
  • 11,492
  • 5
  • 29
  • 37
jayzee
  • 195
  • 1
  • 17
  • 3
    Persistent Volumes + Claims are the Kubernetes way to go. Especially when you are on managed kubernetes engines. You can create PVCs using the gke storage class. this automatically provisions gke persistent disks for your pods, which should be linked to your cloud storage – meaningqo Sep 16 '21 at 07:58
  • 1
    Why do you want to mount Google Cloud Storage? What is your use case? – Serhii Rohoza Sep 16 '21 at 09:50
  • @SerhiiRohoza one of my use cases is that One of my pods generate a screen recording .mp4 file. I want to be able to store these files and see the video after the pod gets completed. Now when the pod dies all the data stored in the pod gets also deleted. I want to save them some place and be persistent – jayzee Sep 16 '21 at 09:54
  • 1
    In such a case, you can follow recommendations provided by @meaningqo. Alternatively you can looks for NFS solution like [Google Filestore](https://cloud.google.com/filestore/docs/accessing-fileshares). – Serhii Rohoza Sep 16 '21 at 10:59
  • 1
    Agree that PV / PVCs are the way to go here. You can either use GCP persistent disks or Filestore as the storage class. Make sure that you choose a storage class with `reclaimPolicy: Retain` to ensure that the data still exists after a pod is deleted. – Gari Singh Sep 17 '21 at 09:10

1 Answers1

0

I post this community wiki answer to make solution discussed at the comment section more visible. Feel free to edid and improve.

As it was suggested by @meaningqo, Persistent Volumes + Claims are the Kubernetes way to go. You can find more information at the documentation.

Alternatively you can looks for NFS solution like Google Filestore. You can find more information at the documentation.

Serhii Rohoza
  • 4,287
  • 2
  • 16
  • 29