Question

Configuring nfs-server with DO Block Storage to support replication in kubernetes

Posted January 7, 2021 386 views
Block StorageKubernetes

The service works with 1 replica only but, when i try to scale the service.
Multi-Attach error for volume
i think this has something to do with DO block storage which supports RWO only.
is there a way to make it work?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi there @jthegreat,

I believe that NFS is not really needed. I’ve recently tested this and it seems to be working as expected with a PersistentVolumeClaim and a DigitalOcean Block storage.

You can follow the steps on how to do that here:

https://www.digitalocean.com/docs/kubernetes/how-to/add-volumes/

Let me know how it goes.
Regards,
Bobby

  • What we are trying to achieve is
    1 Volume only with multiple replicas

    • Hello,

      Yes, a PersistentVolumeClaim should work in this case.

      Regards,
      Bobby

      • Hi @bobbyiliev , I’m trying to solve a similar issue and if you could provide assistance it would be of great help.

        I have a PVC, with Storage Class as “do-block-storage” and I think that the settings “Access Mode: ReadWriteOnce” is what causes this, right?

        By the guide you linked, it says:
        accessModes must be set to ReadWriteOnce. The other parameters, ReadOnlyMany and ReadWriteMany, are not supported by DigitalOcean volumes”

        To enable multiple Pods to access the same Volume/PVC shouldn’t this use other access mode?

        • Hi there,

          Do you get the error only if the pods are scheduled on different nodes?

          I believe that the ReadWriteOnce indicates that the PVC would be mounted to 1 node only, but could then be used by multiple pods on that node.

          Regards,
          Bobby