How to set up a standing volume request using AWS EFS and ReadWriteMany?

I have the following standing requirements for volume and volume:

kind: PersistentVolume
apiVersion: v1
metadata:
  name: kloud
spec:
  capacity:
    storage: 100Gi
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  nfs:
    server: 172.21.51.42
    path: /
    readOnly: false

and

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: kloud
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 100Gi

The nfs server is AWS EFS. I specifically ssh for k8s master and verified that I can manually mount the NFS volume. But when I create a volume and claim with kubectl, it vaguely hangs there waiting:

$ kubectl get pvc
NAME      STATUS    VOLUME    CAPACITY   ACCESSMODES   STORAGECLASS   AGE
kloud     Pending                                      gp2            8s

If I change the mode to ReadWriteOnce, it works as expected and will not hang.

$ kubectl get pvc
NAME      STATUS    VOLUME                                     CAPACITY   ACCESSMODES   STORAGECLASS   AGE
kloud     Bound     pvc-c9a01bff-94d0-11e7-8ed4-0aec4a0f734a   100Gi      RWO           gp2       

Is there something I missed? How can I create an RWX application with k8s and EFS?

+4
source share
1 answer

EFS-Proviler . EFS - Kubernetes : https://github.com/kubernetes-incubator/external-storage/tree/master/aws/efs

:

    kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
  name: aws-efs
provisioner: example.com/aws-efs

PVC :

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: efs
  annotations:
    volume.beta.kubernetes.io/storage-class: "aws-efs"
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 1Mi

, EFS, Kubernetes , - , .

+4

Source: https://habr.com/ru/post/1685330/


All Articles