What would be an ideal way to share writable volume across containers for a web server?

前端 未结 3 870
半阙折子戏
半阙折子戏 2020-12-22 12:25

The application in question is Wordpress, I need to create replicas for rolling deployment / scaling purposes.

It seem can\'t create more then 1 instance of the sam

相关标签:
3条回答
  • 2020-12-22 12:54

    In https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistent-volumes you can see a table with the possible storage classes that allow ReadWriteMany (the option you are looking for).

    • AzureFile (not suitable if you are using GCP)
    • CephFS
    • Glusterfs
    • Quobyte
    • NFS
    • PortworxVolume

    The one that I've tried is that of NFS. I had no issues with it, but I guess you should also consider potential performance issues. However, if the writes are to be occassional, it shouldn't be much of an issue.

    0 讨论(0)
  • 2020-12-22 12:58

    I think what you are trying to solve is having a central location for wordperss media files, in that case this would be a better solution: https://wordpress.org/plugins/gcs/

    Making your kubernetes workload truly stateless and you can scale horizontally.

    0 讨论(0)
  • 2020-12-22 13:03

    You can use Regional Persistent Disk. It can be mounted to many nodes (hence pods) in RW more. These nodes can be spread across two zones within one region. Regional PDs can be backed by standard or SSD disks. Just note that as of now (september 2018) they are still in beta and may be subject to backward incompatible changes.

    Check the complete spec here: https://cloud.google.com/compute/docs/disks/#repds

    0 讨论(0)
提交回复
热议问题