I have configured an "efs-provisioner" on my cluster. I am wondering if there is a way to customize the name of "Persistent Volume" that gets created on applying the following config.
By default a random name like "pvc-8d4a5079-3272-11e8-9838-0ac28eb2d996" being generated.
I want to make this name pre-configured, so that I can avoid to get a list of Volumes for the Namespace and get the ID/name of the volume.
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: efs
annotations:
volume.beta.kubernetes.io/storage-class: "aws-efs"
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
---
Remember that the name is produced randomly in the provisioner's code...So seems impossible
Above is correct. No, sorry, according to the spec we need to make the names of the Persistent Volumes correspond exactly to the random IDs of their Persistent Volume Claims to avoid problems
Maybe filtering your volumes by the storage class "aws-efs" will help a little.
This makes it tricky for cluster re-creation or pointing another cluster to the same efs volume. If re-creating a cluster, you have to manually mount the efs volume and rsync the files. Would be nice to have a field as a pvc identifier so the subpaths aren't random.
How is the issue now, is it still not possible to reuse the existing folder in EFS?
Is there any improvement for this case?
Have the same question.
We plan to create a new k8s cluster and want to be able to reuse existing persistent volume which contains inside EFS.
Most helpful comment
This makes it tricky for cluster re-creation or pointing another cluster to the same efs volume. If re-creating a cluster, you have to manually mount the efs volume and rsync the files. Would be nice to have a field as a pvc identifier so the subpaths aren't random.