I have a kubernetes PersistentVolume
resource defined which uses the efs.csi.aws.com
driver. My question is, I want to specify the target path for this volume (/app_data
). But this folder needs to exists first before I can start mounting them to the container with PersistentVolumeClaims
otherwise it will get error that the target path does not exists. I thought that the folder can be created in the AWS UI or CLI when provisioning the EFS. Something like an S3 where you can create a bucket in the AWS web UI.
apiVersion: v1
kind: PersistentVolume
metadata:
name: app-pv
namespace: my-app
spec:
capacity:
storage: 10Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
storageClassName: app-efs-sc
csi:
driver: efs.csi.aws.com
volumeHandle: fs-1234567
volumeAttributes:
path: "/app_data"