See below I have directories in EFS - data
and logs
. Do I need to create a different PV if I need to use a subpath? And if I do, how do I specify the PV to use for the PVC?
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: efs-pv-data
spec:
capacity:
storage: 5Gi
volumeMode: Filesystem
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
storageClassName: efs-sc
csi:
driver: efs.csi.aws.com
{{/* same EFS ID*/}}
volumeHandle: fs-ABC1234
volumeAttributes:
path: /data
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: efs-pv-logs
spec:
capacity:
storage: 5Gi
volumeMode: Filesystem
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
storageClassName: efs-sc
csi:
driver: efs.csi.aws.com
{{/* same EFS ID*/}}
volumeHandle: fs-ABC1234
volumeAttributes:
path: /logs
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: efs-claim-data
namespace: my-app
spec:
accessModes:
- ReadWriteMany
storageClassName: "efs-sc"
resources:
requests:
storage: 5Gi