<p>I have setup <strong>kops cluster on aws</strong> and also helm is installed in the cluster.</p>
<p>I am trying to install <a href="https://github.com/elastic/helm-charts/tree/master/elasticsearch" rel="nofollow noreferrer">easltic/elasticsearch</a> using the chart. I need to modify the default volume size for that I have create below <code>values.yml</code> file.</p>
<pre><code># Allocate smaller chunks of memory per pod
resources:
    requests:
      cpu: &quot;100m&quot;
      memory: &quot;512M&quot;
    limits:
      cpu: &quot;1000m&quot;
      memory: &quot;512M&quot;


# Request smaller persistent volume
volumeClaimTemplate:
  accessModes: [ &quot;ReadWriteOnce&quot; ]
  storageClassName: default
  resources:
    requests:
      storage: 10Gi
</code></pre>
<p>This is how I installed it,</p>
<pre><code>helm install elasticsearch -n logging elastic/elasticsearch -f values.yml
</code></pre>
<p>Installation is successful, but now pods are stuck in pending state</p>
<pre><code>[ec2-user@ip-my elastic-search]$ kubectl get pods -n logging
NAME                     READY   STATUS    RESTARTS   AGE
elasticsearch-master-0   0/1     Pending   0          6m35s
elasticsearch-master-1   0/1     Pending   0          6m35s
elasticsearch-master-2   0/1     Pending   0          6m35s
</code></pre>
<p>Update:</p>
<pre><code>[ec2-user@my-ip elastic-search]$ kubectl describe pods -n logging elasticsearch-master-0

Name:           elasticsearch-master-0
Namespace:      logging
Priority:       0
Node:           &lt;none&gt;
Labels:         app=elasticsearch-master
                chart=elasticsearch
                controller-revision-hash=elasticsearch-master-697ffb4548
                release=elasticsearch
                statefulset.kubernetes.io/pod-name=elasticsearch-master-0
Annotations:    &lt;none&gt;
Status:         Pending
IP:
IPs:            &lt;none&gt;
Controlled By:  StatefulSet/elasticsearch-master
Init Containers:
  configure-sysctl:
    Image:      docker.elastic.co/elasticsearch/elasticsearch:7.12.0
    Port:       &lt;none&gt;
    Host Port:  &lt;none&gt;
    Command:
      sysctl
      -w
      vm.max_map_count=262144
    Environment:  &lt;none&gt;
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-tmqp9 (ro)
Containers:
  elasticsearch:
    Image:       docker.elastic.co/elasticsearch/elasticsearch:7.12.0
    Ports:       9200/TCP, 9300/TCP
    Host Ports:  0/TCP, 0/TCP
    Limits:
      cpu:     1
      memory:  2Gi
    Requests:
      cpu:      1
      memory:   2Gi
    Readiness:  exec [sh -c #!/usr/bin/env bash -e
# If the node is starting up wait for the cluster to be ready (request params: &quot;wait_for_status=green&amp;timeout=1s&quot; )
# Once it has started only check that the node itself is responding
START_FILE=/tmp/.es_start_file

# Disable nss cache to avoid filling dentry cache when calling curl
# This is required with Elasticsearch Docker using nss &lt; 3.52
export NSS_SDB_USE_CACHE=no

http () {
  local path=&quot;${1}&quot;
  local args=&quot;${2}&quot;
  set -- -XGET -s

  if [ &quot;$args&quot; != &quot;&quot; ]; then
    set -- &quot;$@&quot; $args
  fi

  if [ -n &quot;${ELASTIC_USERNAME}&quot; ] &amp;&amp; [ -n &quot;${ELASTIC_PASSWORD}&quot; ]; then
    set -- &quot;$@&quot; -u &quot;${ELASTIC_USERNAME}:${ELASTIC_PASSWORD}&quot;
  fi

  curl --output /dev/null -k &quot;$@&quot; &quot;http://127.0.0.1:9200${path}&quot;
}

if [ -f &quot;${START_FILE}&quot; ]; then
  echo 'Elasticsearch is already running, lets check the node is healthy'
  HTTP_CODE=$(http &quot;/&quot; &quot;-w %{http_code}&quot;)
  RC=$?
  if [[ ${RC} -ne 0 ]]; then
    echo &quot;curl --output /dev/null -k -XGET -s -w '%{http_code}' \${BASIC_AUTH} http://127.0.0.1:9200/ failed with RC ${RC}&quot;
    exit ${RC}
  fi
  # ready if HTTP code 200, 503 is tolerable if ES version is 6.x
  if [[ ${HTTP_CODE} == &quot;200&quot; ]]; then
    exit 0
  elif [[ ${HTTP_CODE} == &quot;503&quot; &amp;&amp; &quot;7&quot; == &quot;6&quot; ]]; then
    exit 0
  else
    echo &quot;curl --output /dev/null -k -XGET -s -w '%{http_code}' \${BASIC_AUTH} http://127.0.0.1:9200/ failed with HTTP code ${HTTP_CODE}&quot;
    exit 1
  fi

else
  echo 'Waiting for elasticsearch cluster to become ready (request params: &quot;wait_for_status=green&amp;timeout=1s&quot; )'
  if http &quot;/_cluster/health?wait_for_status=green&amp;timeout=1s&quot; &quot;--fail&quot; ; then
    touch ${START_FILE}
    exit 0
  else
    echo 'Cluster is not yet ready (request params: &quot;wait_for_status=green&amp;timeout=1s&quot; )'
    exit 1
  fi
fi
] delay=10s timeout=5s period=10s #success=3 #failure=3
    Environment:
      node.name:                     elasticsearch-master-0 (v1:metadata.name)
      cluster.initial_master_nodes:  elasticsearch-master-0,elasticsearch-master-1,elasticsearch-master-2,
      discovery.seed_hosts:          elasticsearch-master-headless
      cluster.name:                  elasticsearch
      network.host:                  0.0.0.0
      ES_JAVA_OPTS:                  -Xmx1g -Xms1g
      node.data:                     true
      node.ingest:                   true
      node.master:                   true
      node.ml:                       true
      node.remote_cluster_client:    true
    Mounts:
      /usr/share/elasticsearch/data from elasticsearch-master (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-tmqp9 (ro)
Conditions:
  Type           Status
  PodScheduled   False
Volumes:
  elasticsearch-master:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  elasticsearch-master-elasticsearch-master-0
    ReadOnly:   false
  default-token-tmqp9:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-tmqp9
    Optional:    false
QoS Class:       Burstable
Node-Selectors:  &lt;none&gt;
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason            Age                From               Message
  ----     ------            ----               ----               -------
  Warning  FailedScheduling  23s (x2 over 24s)  default-scheduler  0/3 nodes are available: 3 pod has unbound immediate PersistentVolumeClaims.

[ec2-user@my-ip elastic-search]$ kubectl describe statefulset -n logging elasticsearch-master
Name:               elasticsearch-master
Namespace:          logging
CreationTimestamp:  Mon, 19 Apr 2021 03:51:58 +0000
Selector:           app=elasticsearch-master
Labels:             app=elasticsearch-master
                    app.kubernetes.io/managed-by=Helm
                    chart=elasticsearch
                    heritage=Helm
                    release=elasticsearch
Annotations:        esMajorVersion: 7
                    meta.helm.sh/release-name: elasticsearch
                    meta.helm.sh/release-namespace: logging
Replicas:           3 desired | 3 total
Update Strategy:    RollingUpdate
Pods Status:        0 Running / 3 Waiting / 0 Succeeded / 0 Failed
Pod Template:
  Labels:  app=elasticsearch-master
           chart=elasticsearch
           release=elasticsearch
  Init Containers:
   configure-sysctl:
    Image:      docker.elastic.co/elasticsearch/elasticsearch:7.12.0
    Port:       &lt;none&gt;
    Host Port:  &lt;none&gt;
    Command:
      sysctl
      -w
      vm.max_map_count=262144
    Environment:  &lt;none&gt;
    Mounts:       &lt;none&gt;
  Containers:
   elasticsearch:
    Image:       docker.elastic.co/elasticsearch/elasticsearch:7.12.0
    Ports:       9200/TCP, 9300/TCP
    Host Ports:  0/TCP, 0/TCP
    Limits:
      cpu:     1
      memory:  2Gi
    Requests:
      cpu:      1
      memory:   2Gi
    Readiness:  exec [sh -c #!/usr/bin/env bash -e
# If the node is starting up wait for the cluster to be ready (request params: &quot;wait_for_status=green&amp;timeout=1s&quot; )
# Once it has started only check that the node itself is responding
START_FILE=/tmp/.es_start_file

# Disable nss cache to avoid filling dentry cache when calling curl
# This is required with Elasticsearch Docker using nss &lt; 3.52
export NSS_SDB_USE_CACHE=no

http () {
  local path=&quot;${1}&quot;
  local args=&quot;${2}&quot;
  set -- -XGET -s

  if [ &quot;$args&quot; != &quot;&quot; ]; then
    set -- &quot;$@&quot; $args
  fi

  if [ -n &quot;${ELASTIC_USERNAME}&quot; ] &amp;&amp; [ -n &quot;${ELASTIC_PASSWORD}&quot; ]; then
    set -- &quot;$@&quot; -u &quot;${ELASTIC_USERNAME}:${ELASTIC_PASSWORD}&quot;
  fi

  curl --output /dev/null -k &quot;$@&quot; &quot;http://127.0.0.1:9200${path}&quot;
}

if [ -f &quot;${START_FILE}&quot; ]; then
  echo 'Elasticsearch is already running, lets check the node is healthy'
  HTTP_CODE=$(http &quot;/&quot; &quot;-w %{http_code}&quot;)
  RC=$?
  if [[ ${RC} -ne 0 ]]; then
    echo &quot;curl --output /dev/null -k -XGET -s -w '%{http_code}' \${BASIC_AUTH} http://127.0.0.1:9200/ failed with RC ${RC}&quot;
    exit ${RC}
  fi
  # ready if HTTP code 200, 503 is tolerable if ES version is 6.x
  if [[ ${HTTP_CODE} == &quot;200&quot; ]]; then
    exit 0
  elif [[ ${HTTP_CODE} == &quot;503&quot; &amp;&amp; &quot;7&quot; == &quot;6&quot; ]]; then
    exit 0
  else
    echo &quot;curl --output /dev/null -k -XGET -s -w '%{http_code}' \${BASIC_AUTH} http://127.0.0.1:9200/ failed with HTTP code ${HTTP_CODE}&quot;
    exit 1
  fi

else
  echo 'Waiting for elasticsearch cluster to become ready (request params: &quot;wait_for_status=green&amp;timeout=1s&quot; )'
  if http &quot;/_cluster/health?wait_for_status=green&amp;timeout=1s&quot; &quot;--fail&quot; ; then
    touch ${START_FILE}
    exit 0
  else
    echo 'Cluster is not yet ready (request params: &quot;wait_for_status=green&amp;timeout=1s&quot; )'
    exit 1
  fi
fi
] delay=10s timeout=5s period=10s #success=3 #failure=3
    Environment:
      node.name:                      (v1:metadata.name)
      cluster.initial_master_nodes:  elasticsearch-master-0,elasticsearch-master-1,elasticsearch-master-2,
      discovery.seed_hosts:          elasticsearch-master-headless
      cluster.name:                  elasticsearch
      network.host:                  0.0.0.0
      ES_JAVA_OPTS:                  -Xmx1g -Xms1g
      node.data:                     true
      node.ingest:                   true
      node.master:                   true
      node.ml:                       true
      node.remote_cluster_client:    true
    Mounts:
      /usr/share/elasticsearch/data from elasticsearch-master (rw)
  Volumes:  &lt;none&gt;
Volume Claims:
  Name:          elasticsearch-master
  StorageClass:  standard
  Labels:        &lt;none&gt;
  Annotations:   &lt;none&gt;
  Capacity:      10Gi
  Access Modes:  [ReadWriteOnce]
Events:
  Type    Reason            Age    From                    Message
  ----    ------            ----   ----                    -------
  Normal  SuccessfulCreate  2m50s  statefulset-controller  create Pod elasticsearch-master-0 in StatefulSet elasticsearch-master successful
  Normal  SuccessfulCreate  2m50s  statefulset-controller  create Pod elasticsearch-master-1 in StatefulSet elasticsearch-master successful
  Normal  SuccessfulCreate  2m50s  statefulset-controller  create Pod elasticsearch-master-2 in StatefulSet elasticsearch-master successful

[ec2-user@~]$ kubectl describe pvc -n logging elasticsearch-master-0
Error from server (NotFound): persistentvolumeclaims &quot;elasticsearch-master-0&quot; not found
[ec2-user@ip~]$ kubectl get storageclass
NAME                      PROVISIONER             RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
default                   kubernetes.io/aws-ebs   Delete          Immediate              false                  38d
gp2                       kubernetes.io/aws-ebs   Delete          Immediate              false                  38d
kops-ssd-1-17 (default)   kubernetes.io/aws-ebs   Delete          WaitForFirstConsumer   true                   38d
</code></pre>

confusedWarrior
<p>You don't have a StorageClass named <code>standard</code> in your cluster. Use one of the storageClass from your list:</p>
<pre class="lang-sh prettyprint-override"><code>$ kubectl get storageclass
NAME                      PROVISIONER             RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
default                   kubernetes.io/aws-ebs   Delete          Immediate              false                  38d
gp2                       kubernetes.io/aws-ebs   Delete          Immediate              false                  38d
kops-ssd-1-17 (default)   kubernetes.io/aws-ebs   Delete          WaitForFirstConsumer   true                   38d
</code></pre>
<p>Sample:</p>
<pre class="lang-yaml prettyprint-override"><code>volumeClaimTemplate:
  accessModes: [ &quot;ReadWriteOnce&quot; ]
  storageClassName: default
  resources:
    requests:
      storage: 10Gi
</code></pre>
