<p>I need help with persistent volumes set while setting up ELK stack to monitor my kubernetes cluster.</p>
<p>I tired</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>helm install elasticsearch elasticsearch</code></pre>
</div>
</div>

error  :
0/2 nodes are available: 2 pod has unbound immediate PersistentVolumeClaims.</p>
<p>but since i am runnng on prem the persistant voumles are not getting created . How do i specify persistant volumes in the helm install command ?</p>

Santhosh reddy
<p>In glancing <a href="https://github.com/elastic/helm-charts/blob/master/elasticsearch/templates/statefulset.yaml#L26-L44" rel="nofollow noreferrer">through the chart</a>, it looks like it is using Persistent Volume Claim Templates in your Statefulset.</p>
<blockquote>
<p>The volumeClaimTemplates will provide stable storage using PersistentVolumes provisioned by a PersistentVolume Provisioner.</p>
</blockquote>
<p>The chart checks if <a href="https://github.com/elastic/helm-charts/blob/master/elasticsearch/values.yaml#L122-L124" rel="nofollow noreferrer">persistence.labels.enabled</a> is True, and if it is it adds your labels, and then it adds your annotations, and then finally it uses your <a href="https://github.com/elastic/helm-charts/blob/master/elasticsearch/values.yaml#L91-L95" rel="nofollow noreferrer">.Values.volumeClaimTemplate</a>.  So, in the end if you don't change anything in the values, it looks like it will try to create persistent volumes with these specs using your default provisioner:</p>
<pre><code>volumeClaimTemplate:
  accessModes: [ &quot;ReadWriteOnce&quot; ]
  resources:
    requests:
      storage: 30Gi
</code></pre>
<p>So, you should check what your default provisioner is</p>
<pre><code>kubectl get storageclasses
</code></pre>
<p>For example, mine is aws-ebs, and so in my case it would create AWS EBS Volumes.  This doc explains <a href="https://kubernetes.io/docs/tasks/administer-cluster/change-default-storage-class/" rel="nofollow noreferrer">how to change your Default storage class</a> if yours isn't set to something you want.</p>
<blockquote>
<p>Depending on the installation method, your Kubernetes cluster may be
deployed with an existing StorageClass that is marked as default. This
default StorageClass is then used to dynamically provision storage for
PersistentVolumeClaims that do not require any specific storage class.
See PersistentVolumeClaim documentation for details</p>
</blockquote>
<p>You also should be able to specify the Storage Class you want to use, and then pass in something like this in a separate values file:</p>
<pre><code>volumeClaimTemplate:
  accessModes: [ &quot;ReadWriteOnce&quot; ]
  storageClassName: &quot;my-storage-class&quot;
  resources:
    requests:
      storage: 30Gi
</code></pre>
<pre><code>helm install --name elasticsearch elastic/elasticsearch -f values.yaml -f custom-values.yaml
</code></pre>
