ateet
ateet

Reputation: 63

How to enable ReadWriteMany access mode using an io2 EBS Volume

I want to enable ReadWriteMany access mode in EKS Persistent Volume. Came accross io2 volumetype by EBS AWS. SO using io2 type volume

storage_class.yaml

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: io2
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer
parameters:
  type: io2
  iopsPerGB: "200"

persistent_volume.yaml

apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv
spec:
  accessModes:
  - ReadWriteMany
  awsElasticBlockStore:
    fsType: ext4
    volumeID: <IO2 type volume ID>
  capacity:
    storage: 50Gi
  storageClassName: io2
  volumeMode: Filesystem

pv_claim.yaml

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 50Gi
  volumeMode: Filesystem
  volumeName: pv
  storageClassName: io2

When 3 replicas of pods are deployed across 2 nodes in same AZ, 2 replicas (on one node) successfully mounts to the io2 volume and starts running but third replica on another node does not mount to volume.

Error -> Unable to attach or mount volumes: unmounted volumes['']

Also, I want to understand if io2 type volumes are meant to be mount to multiple nodes(EC2 instances in same AZ as volume) in EKS with ReadWriteMany access mode.

Upvotes: 4

Views: 4823

Answers (2)

Cloudlady
Cloudlady

Reputation: 763

I just checked the status of the Feature Request that Matt mentioned, and it looks like they finally implemented it! So, that is definitely one option to solve the ReadWriteMany request. There are a few other possible solutions:

  1. Use EFS. It is AWS’s legacy scalable NFS service. It comes with some caveats though:
    • Significantly more expensive than EBS.
    • Not as performant.
  2. To keep costs down you could spin up your own EC2 instance running a flavor of Linux and run your own NFS server from it. The caveats there would be:
    • You have to maintain it yourself (i.e. patching the O/S)
    • You have to protect it yourself (i.e. network security as well as data protection (e.g. backing it up))
  3. You could use FSx for NetApp ONTAP. It is a managed service like EFS, however, it is not as expensive and is much more performant by providing more throughput with sub-millisecond latency.

Upvotes: 2

Matt
Matt

Reputation: 8152

I looks like there is open feature request on kubernetes-sigs/aws-ebs-csi-driver repo but no progress on this. So I guess that it is not supported at the moment but you can monitor the issue for updates.

Upvotes: 5

Related Questions