<p>I'm trying to install kube-prometheus-stack  using helm and trying to use persistent volume with hospath even after specifying VolumeClaimTemplate the emptyDir is getting created is storage type.</p>
<p>These are steps i followed:</p>
<ol>
<li>Created a PV</li>
</ol>
<pre><code>kind: PersistentVolume
metadata:
  name: prometheus-pv
  labels:
    app: prometheus
spec:
  capacity:
    storage: 50Gi
  hostPath:
    path: /data/prometheus/pv4
    type: ''
  accessModes:
    - ReadWriteOnce
</code></pre>
<ol start="2">
<li>Modified default Values file in storage section :</li>
</ol>
<pre><code>    resources: {}
    # requests:
    #   memory: 400Mi

    ## Prometheus StorageSpec for persistent data
    ## ref: https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/user-guides/storage.md
    ##
    storageSpec:
    ## Using PersistentVolumeClaim
    ##
    volumeClaimTemplate:
      spec:
        storageClassName: &quot;&quot;
        accessModes: [&quot;ReadWriteOnce&quot;]
        resources:
          requests:
            storage: 50Gi
      selector:
          matchLabels:
            app: prometheus
</code></pre>
<ol start="3">
<li>Installed kube-prometheus-stack using helm</li>
</ol>
<pre><code>helm install  --values Prometheus.yaml promethes  prometheus-community/kube-prometheus-stack --namespace prometheusstack
</code></pre>
<ol start="4">
<li>Deployment is successful but the storage is created as <strong>emptyDir</strong>
pod storage snippet</li>
</ol>
<pre><code>spec:
  volumes:
    - name: config
      secret:
        secretName: prometheus-promethes-kube-prometheus-prometheus
        defaultMode: 420
    - name: tls-assets
      secret:
        secretName: prometheus-promethes-kube-prometheus-prometheus-tls-assets
        defaultMode: 420
    - name: config-out
      emptyDir: {}
    - name: prometheus-promethes-kube-prometheus-prometheus-rulefiles-0
      configMap:
        name: prometheus-promethes-kube-prometheus-prometheus-rulefiles-0
        defaultMode: 420
    - name: prometheus-promethes-kube-prometheus-prometheus-db
      emptyDir: {}
    - name: promethes-kube-prometheus-prometheus-token-nwwxv
      secret:
        secretName: promethes-kube-prometheus-prometheus-token-nwwxv
        defaultMode: 420
</code></pre>

<p>You missing identation.
The correct values should be:</p>
<pre><code>    storageSpec:
      ## Using PersistentVolumeClaim
      ##
      volumeClaimTemplate:
        spec:
          storageClassName: &quot;&quot;
          accessModes: [&quot;ReadWriteOnce&quot;]
          resources:
            requests:
              storage: 50Gi
        selector:
          matchLabels:
            app: prometheus
</code></pre>
