title: Configuring Vault-Helm PVC
body: <p>I'm fairly new to K8S and i've been trying to implement vault on k8s.
  I've been trying to deploy Hashicorp Vault on K8S using Helm as written on their website.
       -- <a href="https://www.vaultproject.io/docs/platform/k8s/helm/run/" rel="nofollow noreferrer">https://www.vaultproject.io/docs/platform/k8s/helm/run/</a>
       -- <a href="https://github.com/hashicorp/vault-helm" rel="nofollow noreferrer">https://github.com/hashicorp/vault-helm</a> - Branch 0.4.0</p>
  
  <p>I've come across an issue which is not entirely clear to me.
  in the files, Values.yaml is to be edited in order to configure it for my environment
  while doing so, I've tried to configure it to write to storage, as it's needed.
  this configuration is located in the file like so:</p>
  
  <pre><code>  # This configures the Vault Statefulset to create a PVC for data
    # storage when using the file backend.
    # See https://www.vaultproject.io/docs/configuration/storage/index.html to know more
    dataStorage:
      enabled: true
      # Size of the PVC created
      size: 10Gi
      # Name of the storage class to use.  If null it will use the
      # configured default Storage Class.
      storageClass: null
      # Access Mode of the storage device being used for the PVC
      accessMode: ReadWriteOnce
  </code></pre>
  
  <p>When running this, as it as, its supposed to create a PVC called "data" as thats the default
  specifically:</p>
  
  <blockquote>
    <p>"data-vault-0"</p>
  </blockquote>
  
  <p>this is the message received from the kubectl describe pod vault-0</p>
  
  <blockquote>
    <p>error while running "VolumeBinding" filter plugin for pod "vault-0": pod has unbound immediate > PersistentVolumeClaims</p>
  </blockquote>
  
  <p>following, the command kubectl describe pvc data-vault-0, shows this:</p>
  
  <blockquote>
    <p>persistentvolume-controller  storageclass.storage.k8s.io "data" not found</p>
  </blockquote>
  
  <p>I followed up the way its supposed to configure the PVC, and it uses a helper file called</p>
  
  <blockquote>
    <p>_helpers.tpl</p>
  </blockquote>
  
  <p>in that helper file, it shows the configuration as follows:</p>
  
  <pre><code>{{/*
  Set's up the volumeClaimTemplates when data or audit storage is required.  HA
  might not use data storage since Consul is likely it's backend, however, audit
  storage might be desired by the user.
  */}}
  {{- define "vault.volumeclaims" -}}
    {{- if and (ne .mode "dev") (or .Values.server.dataStorage.enabled .Values.server.auditStorage.enabled) }}
    volumeClaimTemplates:
        {{- if and (eq (.Values.server.dataStorage.enabled | toString) "true") (eq .mode "standalone") }}
      - metadata:
          name: data
        spec:
          accessModes:
            - {{ .Values.server.dataStorage.accessMode | default "ReadWriteOnce" }}
          resources:
            requests:
              storage: {{ .Values.server.dataStorage.size }}
            {{- if .Values.server.dataStorage.storageClass }}
          storageClassName: {{ .Values.server.dataStorage.storageClass }}
            {{- end }}
        {{ end }}
  </code></pre>
  
  <p>i drilled down into k8s with pvc and pv.
  it seemes to me that i need to define a pv and ONLY THEN can this entire chart load properly
  problem is...
  im a bit lost at how to do it so that it can work with this chart
  do i need to deploy using a separate k8s deploy? like writing a specific yaml for pv and then run the chart?</p>
  
  <p>has anyone dealt with this before and can offer pointers?</p>
  
  <p>thanks!</p>