Volume claim templatesedit

By default the operator creates a PersistentVolumeClaim with a capacity of 1Gi for every Pod in an Elasticsearch cluster. This is to ensure that there is no data loss if a Pod is deleted.

You can customize the volume claim templates used by Elasticsearch to adjust the storage to your needs. The name in the template must be elasticsearch-data:

spec:
  nodes:
  - volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 5Gi
        storageClassName: standard

If you want to use an emptyDir volume, specify the elasticsearch-data volume in the podTemplate:

spec:
  nodes:
  - config:
    podTemplate:
      spec:
        volumes:
        - name: elasticsearch-data
          emptyDir: {}

Using emptyDir might result in data loss and is not recommended.