Elasticsearch statefulset does not create volumesClaims on rook-cephfs

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?



Read more here: https://stackoverflow.com/questions/66249958/elasticsearch-statefulset-does-not-create-volumesclaims-on-rook-cephfs

Content Attribution

This content was originally published by zozo6015 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: