no persistent volumes available for this claim on kubernetes

217 Views Asked by At

I'm trying to set up elasticsearch on kubernetes with Helm(helm install elasticsearch elastic/elasticsearch -n efk). I get the error "no persistent volumes available for this claim and no storage class is set". how can i solve

Log

LAST SEEN           TYPE      REASON               OBJECT                                                              MESSAGE
18s (x2 over 18s)   Normal    NoPods               PodDisruptionBudget/elasticsearch-master-pdb                        No matching pods found
18s                 Normal    SuccessfulCreate     StatefulSet/elasticsearch-master                                    create Claim elasticsearch-master-elasticsearch-master-2 Pod elasticsearch-master-2 in StatefulSet elasticsearch-master success
18s                 Normal    SuccessfulCreate     StatefulSet/elasticsearch-master                                    create Pod elasticsearch-master-1 in StatefulSet elasticsearch-master successful
18s                 Normal    SuccessfulCreate     StatefulSet/elasticsearch-master                                    create Claim elasticsearch-master-elasticsearch-master-1 Pod elasticsearch-master-1 in StatefulSet elasticsearch-master success
18s                 Normal    SuccessfulCreate     StatefulSet/elasticsearch-master                                    create Pod elasticsearch-master-0 in StatefulSet elasticsearch-master successful
18s                 Normal    SuccessfulCreate     StatefulSet/elasticsearch-master                                    create Claim elasticsearch-master-elasticsearch-master-0 Pod elasticsearch-master-0 in StatefulSet elasticsearch-master success
18s                 Normal    SuccessfulCreate     StatefulSet/elasticsearch-master                                    create Pod elasticsearch-master-2 in StatefulSet elasticsearch-master successful
18s                 Warning   FailedScheduling     Pod/elasticsearch-master-0                                          0/4 nodes are available: 4 pod has unbound immediate PersistentVolumeClaims. preemption: 0/4 nodes are available: 4 Preemption is not helpful for scheduling.
18s                 Warning   FailedScheduling     Pod/elasticsearch-master-1                                          0/4 nodes are available: 4 pod has unbound immediate PersistentVolumeClaims. preemption: 0/4 nodes are available: 4 Preemption is not helpful for scheduling.
18s                 Warning   FailedScheduling     Pod/elasticsearch-master-2                                          0/4 nodes are available: 4 pod has unbound immediate PersistentVolumeClaims. preemption: 0/4 nodes are available: 4 Preemption is not helpful for scheduling.
16s                 Warning   FailedScheduling     Pod/elasticsearch-master-0                                          0/4 nodes are available: 4 pod has unbound immediate PersistentVolumeClaims. preemption: 0/4 nodes are available: 4 Preemption is not helpful for scheduling.
16s                 Warning   FailedScheduling     Pod/elasticsearch-master-1                                          0/4 nodes are available: 4 pod has unbound immediate PersistentVolumeClaims. preemption: 0/4 nodes are available: 4 Preemption is not helpful for scheduling.
8s (x2 over 18s)    Normal    FailedBinding        PersistentVolumeClaim/elasticsearch-master-elasticsearch-master-0   no persistent volumes available for this claim and no storage class is set
8s (x2 over 18s)    Normal    FailedBinding        PersistentVolumeClaim/elasticsearch-master-elasticsearch-master-2   no persistent volumes available for this claim and no storage class is set
8s (x2 over 18s)    Normal    FailedBinding        PersistentVolumeClaim/elasticsearch-master-elasticsearch-master-1   no persistent volumes available for this claim and no storage class is set
1

There are 1 best solutions below

0
Dion V On
In order to do achieve this, first you have to create StorageClass, you can refer to this documentation on how you can set your storage class in yaml manifest.

 

You can use as reference this yaml from willes

apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: quickstart
spec:
  version: 7.6.2
  nodeSets:
  - name: default
    count: 3
    config:
      node.master: true
      node.data: true
      node.ingest: true
      node.store.allow_mmap: false
    volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 5Gi
        storageClassName: standard