DEV Community

Akhil Sai Latchireddi
Akhil Sai Latchireddi

Posted on

Dynamic provisioning of Persistent Volumes using Amazon EFS CSI driver in EKS.

EFS CSI driver supports both static and dynamic provisioning.

dynamic provisioning creates an access point for each pv under the hood. This means you have to create an Amazon EFS file system manually and provide it as input to the storage class parameters. it will not create the EFS automatically.

sample manifest file for dynamic provisioning

— -

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: my-efs-sc-1
provisioner: efs.csi.aws.com
parameters:
provisioningMode: efs-ap
fileSystemId: fs-01207d73335d8dbb5####PLEASE UPDATE FILESYSTEM ID
directoryPerms: “700”

— -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: efs-claim-1
spec:
accessModes:
— ReadWriteMany
storageClassName: my-efs-sc-1
resources:
requests:
storage: 50Gi
— -
apiVersion: v1
kind: Pod
metadata:
name: efs-app-1
spec:
containers:
— name: app
image: centos
command: [“/bin/sh”]
args: [“-c”, “while true; do echo $(date -u) >> /data/out; sleep 5; done”]
volumeMounts:
— name: persistent-storage
mountPath: /data
volumes:
— name: persistent-storage
persistentVolumeClaim:
claimName: efs-claim-1

Top comments (0)