I am trying to migrate my deployment from the Minikube platform to the KOPS cluster in AWS. In my deployment, I have multiple pods that share the same pvc(persistent volume claim).
Therefore, accessing ebs pvc from different pods in the KOPS cluster is having problems when those pods are running on different nodes(different instances). For eg - I have 3 pods and 2 nodes. Assume pod1 is running on node1 and pod2&pod3 are running on node2. pod2&pod3 will not be able to attach ebs pvc after pod1 is attached to ebs pvc.
How to make ebs pvc accessible from different pods running on different nodes in the kops cluster in AWS?
volume.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: media-volume
spec:
storageClassName: gp2-manual
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
awsElasticBlockStore:
fsType: ext4
volumeID: <volumeID>
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: media-volume-claim
spec:
storageClassName: gp2-manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
ReadWriteOnce
toReadWriteMany
? As mentioned in the documentationReadWriteOnce -- the volume can be mounted as read-write by a single node
. – Jakub