<p>i am a begginer in kubernetes i am trying to run an elasticsearch cluster in it for nthat i am following this (tutorial)[https://phoenixnap.com/kb/elasticsearch-helm-chart] followed all the commands as it is and in the ebnd when i do</p>
<pre><code>kubectl get pods --namespace=default -l app=elasticsearch-master -w
</code></pre>
<p>i am getting</p>
<pre><code>NAME                     READY   STATUS     RESTARTS   AGE
elasticsearch-master-0   0/1     Init:0/1   0          55s
elasticsearch-master-1   0/1     Init:0/1   0          55s
elasticsearch-master-2   0/1     Init:0/1   0          55s
</code></pre>
<p>they are not turning into ready state
and the command</p>
<pre><code>helm test elasticsearch
</code></pre>
<p>got stuck and does not respond</p>
<p>here are the logs</p>
<pre><code>kubectl logs -f elasticsearch-master-0
Error from server (BadRequest): container &quot;elasticsearch&quot; in pod &quot;elasticsearch-master-0&quot; is waiting to start: PodInitializing
 kubectl logs -f elasticsearch-master-1
Error from server (BadRequest): container &quot;elasticsearch&quot; in pod &quot;elasticsearch-master-1&quot; is waiting to start: PodInitializing
 kubectl logs -f elasticsearch-master-2
Error from server (BadRequest): container &quot;elasticsearch&quot; in pod &quot;elasticsearch-master-2&quot; is waiting to start: PodInitializing
</code></pre>
<p>and the <code>kubectl cluster-info</code>
returning</p>
<pre><code>{
  &quot;kind&quot;: &quot;Status&quot;,
  &quot;apiVersion&quot;: &quot;v1&quot;,
  &quot;metadata&quot;: {
    
  },
  &quot;status&quot;: &quot;Failure&quot;,
  &quot;message&quot;: &quot;services \&quot;kube-dns:dns\&quot; is forbidden: User \&quot;system:anonymous\&quot; cannot get resource \&quot;services/proxy\&quot; in API group \&quot;\&quot; in the namespace \&quot;kube-system\&quot;&quot;,
  &quot;reason&quot;: &quot;Forbidden&quot;,
  &quot;details&quot;: {
    &quot;name&quot;: &quot;kube-dns:dns&quot;,
    &quot;kind&quot;: &quot;services&quot;
  },
  &quot;code&quot;: 403
}
</code></pre>
<p>that's all i know right now as i am a begenier in it please help why my elasticsearch nodes are not getting ready</p>

swaheed
<p>There is an <a href="https://github.com/elastic/helm-charts/issues/775" rel="nofollow noreferrer">open issue around this helm on GitHub</a>.</p>
<pre><code>Check once which storage class you have for PVC creation. 
</code></pre>
<p>however, still, there could be multiple reasons for this issue like <strong>PVC</strong> is not getting created or others.</p>
<p>You can try if single node <strong>Elasticsearch</strong> working or not with <strong>PVC</strong> dynamic creation using :</p>
<pre><code>apiVersion: apps/v1
kind: StatefulSet
metadata:
  labels:
    app : elasticsearch
    component: elasticsearch
    release: elasticsearch
  name: elasticsearch
spec:
  podManagementPolicy: Parallel
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app : elasticsearch
      component: elasticsearch
      release: elasticsearch
  serviceName: elasticsearch
  template:
    metadata:
      creationTimestamp: null
      labels:
        app : elasticsearch
        component: elasticsearch
        release: elasticsearch
    spec:
      containers:
      - env:
        - name: cluster.name
          value: &lt;SET THIS&gt;
        - name: discovery.type
          value: single-node
        - name: ES_JAVA_OPTS
          value: -Xms512m -Xmx512m
        - name: bootstrap.memory_lock
          value: &quot;false&quot;
        image: elasticsearch:6.5.0
        imagePullPolicy: IfNotPresent
        name: elasticsearch
        ports:
        - containerPort: 9200
          name: http
          protocol: TCP
        - containerPort: 9300
          name: transport
          protocol: TCP
        resources:
          limits:
            cpu: 250m
            memory: 1Gi
          requests:
            cpu: 150m
            memory: 512Mi
        securityContext:
          privileged: true
          runAsUser: 1000
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /usr/share/elasticsearch/data
          name: elasticsearch-data
      dnsPolicy: ClusterFirst
      initContainers:
      - command:
        - sh
        - -c
        - chown -R 1000:1000 /usr/share/elasticsearch/data
        - sysctl -w vm.max_map_count=262144
        - chmod 777 /usr/share/elasticsearch/data
        - chomod 777 /usr/share/elasticsearch/data/node
        - chmod g+rwx /usr/share/elasticsearch/data
        - chgrp 1000 /usr/share/elasticsearch/data
        image: busybox:1.29.2
        imagePullPolicy: IfNotPresent
        name: set-dir-owner
        resources: {}
        securityContext:
          privileged: true
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /usr/share/elasticsearch/data
          name: elasticsearch-data
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 10
  updateStrategy:
    type: OnDelete
  volumeClaimTemplates:
  - metadata:
      creationTimestamp: null
      name: elasticsearch-data
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 10Gi
</code></pre>
