-1

I am trying to deploy an elasticsearch statfulset and have the storage provisioned by rook-ceph storageclass.

The pod is in pending mode because of: Warning FailedScheduling 87s default-scheduler 0/4 nodes are available: 4 pod has unbound immediate PersistentVolumeClaims.

The statefull set looks like this:

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: elasticsearch
  namespace: rcc
  labels:
    app: elasticsearch
    tier: backend
    type: db
spec:
  serviceName: es
  replicas: 3
  selector:
    matchLabels:
      app: elasticsearch
      tier: backend
      type: db
  template:
    metadata:
      labels:
        app: elasticsearch
        tier: backend
        type: db
    spec:
      terminationGracePeriodSeconds: 300
      initContainers:
      - name: fix-the-volume-permission
        image: busybox
        command:
        - sh
        - -c
        - chown -R 1000:1000 /usr/share/elasticsearch/data
        securityContext:
          privileged: true
        volumeMounts:
        - name: data
          mountPath: /usr/share/elasticsearch/data
      - name: increase-the-vm-max-map-count
        image: busybox
        command:
        - sysctl
        - -w
        - vm.max_map_count=262144
        securityContext:
          privileged: true
      - name: increase-the-ulimit
        image: busybox
        command:
        - sh
        - -c
        - ulimit -n 65536
        securityContext:
          privileged: true
      containers:
      - name: elasticsearch
        image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.7.1
        ports:
        - containerPort: 9200
          name: http
        - containerPort: 9300
          name: tcp
        resources:
          requests:
            memory: 4Gi
          limits:
            memory: 6Gi
        env:
          - name: cluster.name
            value: elasticsearch
          - name: node.name
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: discovery.zen.ping.unicast.hosts
            value: "elasticsearch-0.es.default.svc.cluster.local,elasticsearch-1.es.default.svc.cluster.local,elasticsearch-2.es.default.svc.cluster.local"
          - name: ES_JAVA_OPTS
            value: -Xms4g -Xmx4g
        volumeMounts:
        - name: data
          mountPath: /usr/share/elasticsearch/data
  volumeClaimTemplates:
  - metadata:
      name: data
    spec:
      accessModes:
        - ReadWriteOnce
      storageClassName: rook-cephfs
      resources:
        requests:
          storage: 5Gi

and the reson of the pvc is not getting created is:

Normal FailedBinding 47s (x62 over 15m) persistentvolume-controller no persistent volumes available for this claim and no storage class is set

Any idea what I do wrong?

zozo6015
  • 557
  • 2
  • 11
  • 27
  • Are you able to create other PVCs using that `storageClassName:`, just not within the ES StatefulSet, or all PVCs bomb in the same way? What troubleshooting steps have you already tried? – mdaniel Feb 17 '21 at 21:33
  • yes I have other pvc’s running on the same storageclass with no issues – zozo6015 Feb 18 '21 at 05:34
  • as throubleshooting steps I have tried to create PV's manually but they did not work either. – zozo6015 Feb 18 '21 at 10:25
  • Then how about editing your question to include the actions you took and their outcomes; we are not at your computer to know what you know, so help us to help you – mdaniel Feb 18 '21 at 16:52
  • I have changed the storageClassName to rook-ceph-block and it's working – zozo6015 Feb 18 '21 at 23:59

1 Answers1

0

After adding rook-ceph-block storage class and changing the storageclass to that it worked without any issues.

zozo6015
  • 557
  • 2
  • 11
  • 27