elastic / cloud-on-k8s

Elastic Cloud on Kubernetes
Other
2.58k stars 702 forks source link

Disable creation of PersistentVolume #6238

Open ben5556 opened 1 year ago

ben5556 commented 1 year ago

Elastic documentation on installing Elasticsearch using ECK operator says the below

By default, the operator creates a PersistentVolumeClaim with a capacity of 1Gi for each pod in an Elasticsearch cluster to prevent data loss in case of accidental pod deletion.

Link to documentation here

However, I want to disable this persistent volume creation as I am intending to use local instance store volumes on AWS EC2.

Setting the volumeClaimTemplates: {} or volumeClaimTemplates: [] in yaml didn't seem to help

thbkrkr commented 1 year ago

Hello,

However, I want to disable this persistent volume creation as I am intending to use local instance store volumes on AWS EC2.

I'm not sure I understand what you want to achieve. Don't you want to use a Local Storage Static Provisioner and therefore PV/PVC (https://aws.amazon.com/fr/blogs/containers/eks-persistent-volumes-for-instance-store/)? If not, what kind of volume do you want to use to store the elasticsearch data?

ECK will not configure a default PVC of 1Gi if:

spec:
  nodeSets:
  - name: data
    count: 10
    volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 5Ti
        storageClassName: standard
spec:
  nodeSets:
  - name: data
    count: 10
    podTemplate:
      spec:
        volumes:
        - name: elasticsearch-data
          emptyDir: {}