How do I map a Persistent Volume Claim to Object Storage in K8's

Hi Linode!,

I've currently got a WordPress instance scaled up with 3 MariaDB servers. Looking for a shared storage option to scale up the WordPress instances, and it looks like Object Storage could be an option.

Do you have an example of how to connect to map to object storage with k8s?

Regards
Matt

4 Replies

Object Storage (OBJ) exists as a separate entity and doesn’t have to be mounted to a host server to be utilized. Since each object has a unique URL, you can access data from anywhere and different clients can read from and write to your buckets.

Given this, you wouldn’t necessarily use Object Storage as a persistent volume - that would be more applicable to Block Storage (BS), which requires a host. Unlike OBJ, BS is mounted to a server, so it would need to persist whenever nodes are destroyed and redeployed to a k8 cluster.

For your purposes, the below link contains documentation on how you can use S3-compatible storage engines, like Linode OBJ, to store tables from your MariaDB clusters:

https://mariadb.com/kb/en/s3-storage-engine/

To explore our Block Storage option, you can review this guide:
Deploy Persistent Volume Claims with the Linode Block Storage CSI Driver; however it’s worth noting that storing db files in block storage can make for slow performance - our BS utilizes HDD disks, which are slower than the SSD disks used for a Linode server’s inherent storage. More details about this consideration can be found in this Community post: How do I move my database files to a Block Storage Volume?

Finally, for a general understanding of persistent volumes and Kubernetes, I’d recommend reading through the material available on Kubernetes.io:

https://kubernetes.io/docs/concepts/storage/persistent-volumes/

Hi jtoscani,

Thanks for your reply.

I was thinking more in terms of being able to scale up the WordPress pods, I could probably use s3 storage for the media files but what about all the other static files like plugins. Does block storage currently support ReadWriteMany or would It be best to have a pod to rsync these files across many pods?

@mchase77 - Currently the only mode supported by Block Storage is ReadWriteOnce, as it can only be connected to one Kubernetes node at a time.

Hi,

Is ReadWriteMany on the roadmap ?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct