user3008410
user3008410

Reputation: 848

Kubernetes shared File System across Pods

A question that I can’t seem to find a good answer to and am so confused as to what should be an easy answer. I guess you can say I can't see the forest for the trees.

I have N Pods that need access to the same shared FILE SYSTEM (contains 20Gig of pdfs, HTML) only read. I don’t want to copy it to each Pod and create a Volume in Docker. How should I handle this? I don’t see this as a Stateful App where each pod gets its own changed data.

Upvotes: 0

Views: 2133

Answers (2)

seshadri_c
seshadri_c

Reputation: 7340

The question is quite open-ended. However having gone through this thought process recently, I can come up with two options:

  1. hostPath: You mount this data (probably from NFS or some such) at /data (for example) on all your Kubernetes nodes. Then in Pod specification, you attach volume of type hostPath with path: /data.

  2. GlusterFS volume: This is the option we finally went for, for high availability and speed requirements. The same GlusterFS volume (having the PDFs, data, etc.) can be attached to multiple Pods.

Upvotes: 1

Matt
Matt

Reputation: 74680

The persistent volume access mode is called ReadOnlyMany. Not all volume plugins or CSI drivers support this mode (the linked docco maintains a table for support).

If you are hosting on EKS/AKS/GKE they all provide services based on file shares that can do it. Elsewhere you can use an NFS server.

Upvotes: 1

Related Questions