<p>Within one helm chart I deploy a PersistentVolume (EFS):</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: {{ .Release.Namespace }}-{{ .Release.Name }}
spec:
  capacity:
    storage: 5Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  storageClassName: {{ .Values.pv.storageClassName }}
  csi:
    driver: efs.csi.aws.com
    volumeHandle: {{ .Values.pv.volumeHandle | quote }}
  claimRef:
    name: {{ .Release.Name }}
    namespace: {{ .Release.Namespace }}
</code></pre>
<p>And PersistentVolumeClaim for it:</p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ .Release.Name }}
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: {{ .Values.pv.storageClassName }}
  resources:
    requests:
      storage: 5Gi  # Required but ignored in case of EFS
  volumeName: {{ .Release.Namespace }}-{{ .Release.Name }}
</code></pre>
<p>And a pod uses the PVC as usual:</p>
<pre><code>volumeMounts:
  - name: persistent-storage
    mountPath: /efs

...
  volumes:
    - name: persistent-storage
      persistentVolumeClaim:
        claimName: {{ .Release.Name }}
</code></pre>
<p>When I do helm install, I have a floating issue: pods continuously in a pending state with the next event:</p>
<blockquote>
<p>Warning  FailedScheduling  56s   fargate-scheduler  Pod not supported on Fargate: volumes not supported: persistent-storage not supported because: PVC someRelease not bound</p>
</blockquote>
<p>If I would check state of the PVC, it's in Bound state and after a pod restart it works as expected. It looks like PV is not created yet at the moment when PVC tries to access it, hence the pod can't be created. Should I specify an order for the templates somehow or there is another solution?</p>

Anton Balashov
<p>Try the following:</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: {{ .Release.Name }}
spec:
  capacity:
    storage: 5Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  storageClassName: &quot;&quot;
  csi:
    driver: efs.csi.aws.com
    volumeHandle: {{ .Values.pv.volumeHandle | quote }}
  claimRef:
    name: {{ .Release.Namespace }}-{{ .Release.Name }}


apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ .Release.Namespace }}-{{ .Release.Name }}
  namespace: {{ .Release.Namespace }}
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: &quot;&quot;
  resources:
    requests:
      storage: 5Gi  # Required but ignored in case of EFS
</code></pre>
