apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: elasticsearch
  namespace: '{{ meta.namespace }}'
spec:
  auth: {}
  http:
    service:
      metadata: {}
      spec: {}
    tls:
      certificate:
        secretName: elasticsearch-es-cert
  monitoring:
    logs: {}
    metrics: {}
  nodeSets:
  - count: {{ servicetelemetry_vars.backends.events.elasticsearch.node_count }}
    name: default
    config:
      node.roles:
      - master
      - data
      - ingest
      node.store.allow_mmap: true
{% if servicetelemetry_vars.backends.events.elasticsearch.storage.strategy == "persistent" %}
    volumeClaimTemplates:
      - metadata:
          name: elasticsearch-data
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: {{ servicetelemetry_vars.backends.events.elasticsearch.storage.persistent.pvc_storage_request }}
{%   if servicetelemetry_vars.backends.events.elasticsearch.storage.persistent.storage_selector %}
          selector: {{ servicetelemetry_vars.backends.events.elasticsearch.storage.persistent.storage_selector }}
{%   endif %}
{%   if servicetelemetry_vars.backends.events.elasticsearch.storage.persistent.storage_class | length %}
          storageClassName: {{ servicetelemetry_vars.backends.events.elasticsearch.storage.persistent.storage_class }}
{%   endif %}
{% endif %}
    podTemplate:
      metadata:
        labels:
          tuned.openshift.io/elasticsearch: elasticsearch
      spec:
        containers:
        - name: elasticsearch
          resources:
            limits:
              cpu: "2"
              memory: 4Gi
            requests:
              cpu: "1"
              memory: 4Gi
{% if servicetelemetry_vars.backends.events.elasticsearch.storage.strategy == "ephemeral" %}
        volumes:
        - emptyDir: {}
          name: elasticsearch-data
{% endif %}
  transport:
    service:
      metadata: {}
      spec: {}
    tls:
      certificate: {}
  updateStrategy:
    changeBudget: {}
  version: 7.10.2
  volumeClaimDeletePolicy: DeleteOnScaledownOnly
