<p>hy folks </p>

<p>i made the yaml files to deploy my application and now i working with helm to deploy it automatically.However although all of my conf files dor kubernetes worked. i've a problem with helm and <code>PVC</code>. 
i ve checked on internet and i dont find where is my mistake :( </p>

<p><strong>pvc-helm.yaml</strong></p>

<pre><code>{{- if .Values.persistence.enabled }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: {{ .Values.persistence.name }}
  namespace: {{ .Values.persistence.namespace }}
  spec:
    accessModes:
    - {{ .Values.persistence.accessModes | quote }}
    resources:
      requests:
        storage: {{ .Values.persistence.size | quote }}
{{- end }}  
</code></pre>

<p><strong>values.yaml</strong></p>

<pre><code>persistence:
  enabled: true
  name: ds-pvc
  namespace: ds-svc
  storageClassName: standard
  storageClass: standard
  accessModes:
    - ReadWriteOnce
  size: 20Mi
</code></pre>

<p>when i run the command <code>helm install cas/ --tls</code> i get the error below </p>

<blockquote>
  <p>Error: release brawny-olm failed: PersistentVolumeClaim "ds-pvc" is
  invalid: [spec.accessModes: Required value: at least 1 access mode is
  required, spec.resources[storage]: Required value]</p>
</blockquote>

<p>Do i've to set as well a <code>PersistentVolume</code> ? </p>

morla
<p>If you want to have optional values you should check if they have been defined</p>

<pre><code>spec:
  {{- if .Values.persistence.accessModes }}
  accessModes:
  - {{ .Values.persistence.accessModes | quote }}
  {{- end }}
</code></pre>

<p>another option is define a default value on the <code>values.yaml</code> file</p>
