Stuck pending elasticdeployment pods

Hello community,

Executing the command: kubectl get eventss -w

got this events:

0s Warning FailedScheduling pod/quickstart-es-default-0 0/3 nodes are available: 3 pod has unbound immediate PersistentVolumeClaims.
0s Normal FailedBinding persistentvolumeclaim/elasticsearch-data-quickstart-es-default-0 no persistent volumes available for this claim and no storage class is set

do I need to create pv and pvc or Need to edit the deployment. so if yo show me the commands help me a lot of.

hope your comments.

Hi @javig12, thanks for your question.

Can you show the manifest you are using (output of kubectl get -o yaml es quickstart)? From the error I'd guess that either the storage class you specified doesn't exist or maybe there is no (default) storage class defined? You can check both with kubectl get sc.

There should be no need to create PV/PVC manually nor edit the Deployment resource.

Hello dkow, thanks for you response.

Here the results, kubetctl get -o yaml es quickstart:

apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
annotations:
common.k8s.elastic.co/controller-version: 1.2.1
elasticsearch.k8s.elastic.co/initial-master-nodes: quickstart-es-default-0
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"elasticsearch.k8s.elastic.co/v1","kind":"Elasticsearch","metadata":{"annotations":{},"name":"quickstart","namespace":"default"},"spec":{"nodeSets":[{"count":1,"name":"default","podTemplate":{"spec":{"containers":[{"env":[{"name":"ES_JAVA_OPTS","value":"-Xms2g -Xmx2g"}],"name":"elasticsearch","resources":{"limits":{"cpu":2,"memory":"4Gi"},"requests":{"cpu":0.5,"memory":"4Gi"}}}]}}}],"version":"7.9.1"}}
creationTimestamp: "2020-09-21T16:00:23Z"
generation: 2
managedFields:

  • apiVersion: elasticsearch.k8s.elastic.co/v1
    fieldsType: FieldsV1
    fieldsV1:
    f:metadata:
    f:annotations:
    .: {}
    f:kubectl.kubernetes.io/last-applied-configuration: {}
    f:spec:
    .: {}
    f:version: {}
    manager: kubectl-client-side-apply
    operation: Update
    time: "2020-09-21T16:00:23Z"
  • apiVersion: elasticsearch.k8s.elastic.co/v1
    fieldsType: FieldsV1
    fieldsV1:
    f:metadata:
    f:annotations:
    f:common.k8s.elastic.co/controller-version: {}
    f:elasticsearch.k8s.elastic.co/initial-master-nodes: {}
    f:spec:
    f:auth: {}
    f:http:
    .: {}
    f:service:
    .: {}
    f:metadata:
    .: {}
    f:creationTimestamp: {}
    f:spec: {}
    f:tls:
    .: {}
    f:certificate: {}
    f:nodeSets: {}
    f:transport:
    .: {}
    f:service:
    .: {}
    f:metadata:
    .: {}
    f:creationTimestamp: {}
    f:spec: {}
    f:updateStrategy:
    .: {}
    f:changeBudget: {}
    f:status:
    .: {}
    f:health: {}
    f:phase: {}
    manager: elastic-operator
    operation: Update
    time: "2020-09-21T16:00:27Z"
    name: quickstart
    namespace: default
    resourceVersion: "643953"
    selfLink: /apis/elasticsearch.k8s.elastic.co/v1/namespaces/default/elasticsearches/quickstart
    uid: 3204d30f-48c1-4df7-823b-c9694a5a2c52
    spec:
    auth: {}
    http:
    service:
    metadata:
    creationTimestamp: null
    spec: {}
    tls:
    certificate: {}
    nodeSets:
  • count: 1
    name: default
    podTemplate:
    metadata:
    creationTimestamp: null
    spec:
    containers:
    - env:
    - name: ES_JAVA_OPTS
    value: -Xms2g -Xmx2g
    name: elasticsearch
    resources:
    limits:
    cpu: "2"
    memory: 4Gi
    requests:
    cpu: 500m
    memory: 4Gi
    transport:
    service:
    metadata:
    creationTimestamp: null
    spec: {}
    updateStrategy:
    changeBudget: {}
    version: 7.9.1
    status:
    health: unknown
    phase: ApplyingChanges

Result kubectl get sc

No resources found

Your Elasticsearch resource looks fine, but the issue seems to be that there are is no storage class defined. You can read more in our docs. If you just want to get it running right now, you can consider using emptyDir - see the bottom of the page I've linked. Note that this is not recommended for any production use, but can unblock you until you figure out the storage class part.

1 Like

Hello dkow,

Got this error now:
"0/3 nodes are available: 3 node(s) didn't find available persistent volumes to bind"

So, as doc says, I've created storageclass and pv (Local Storage):

NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
persistentvolume/elasticsearch 5Gi RWO Retain Available local-storage 49m
persistentvolume/elasticsearch-data 5Gi RWO Retain Available local-storage 20h

NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
elasticsearch kubernetes.io/no-provisioner Delete WaitForFirstConsumer false 19h
elasticsearch-data kubernetes.io/no-provisioner Delete WaitForFirstConsumer false 19h

So I dont know what else I need. this my storageclass:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: elasticsearch
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer

hope comments.
Regards

The storage class looks fine. If the persistent volume is correct (how did you create it?), you should make sure that your Elasticsearch resource contains volumeClaimTemplates part and it references your storage class name (see below). I didn't see it added in the output you've posted.

spec:
  nodeSets:
  - name: default
    count: 3
    volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 5Gi
        storageClassName: elasticsearch

Also, can you format any output using ```output goes here```? It'll be much easier to read.

1 Like