Kubernetes Cluster Persistent Volumes Replica Attach

March 4, 2019 596 views
Kubernetes Block Storage WordPress

So here is the deal - I am wanting to setup a proper Kubernetes cluster and move my projects onto it. There are things I need;

  • Ability to horizontally scale based on load (Auto-Scale)
  • Ability to share a persistent volume claim
  • Ability to add more nodes as volume increases

What I am having an issue figuring out is the volume sharing. I get I can use Persistent Volumes to get the job done but with csi it uses ReadWriteOnce. Do I need to setup an NFS pod first and connect it to the Block Storage or is there another way.

I must tell you I am EXTREMELY new to Containerization, so please bear with me if my question.

2 Answers

Hey friend,

Thanks for asking this question here. You're on a great path. As confusing as it can be to move into containerization at first, it sounds like you've got a pretty decent handle on it.

For what you're wanting to do there, an NFS container is probably a somewhat ideal path. I'd like to consider a different path altogether though. Network file systems can be less than ideal. Something like object storage (Spaces, comparable to S3) tends to shine in the place of something like that. You might consider if this is usable for your project.

Jarland

The issue with Spaces in this case is during migration from one service to another. I need a way to share php files between the web containers while I migrate to a new Laravel/Vue solution. I am not sure what the best way is for me to accomplish this and the only way I can visualize it in my head is to create one of the following:

  • Ceph/GlusterFS
  • NFS Volume
  • Spaces using s3fs

The long term goal (which I am sure is yours at DO as well) is to move everything to your managed services so in an ideal world I would have all my app services (frontend, api, socket.io) services running in containers, MySQL/Redis running in Managed Database and so on.

I think I just need to think about this more. I guess I look at this like how would this work with wordpress. I would think it would need to share data across the containers. Am I wrong?

Have another answer? Share your knowledge.