clusterName: "elasticsearch"
nodeGroup: "build"
replicas: 6
image: "us.gcr.io/commerce-product/performance/elastic/elasticsearch"
imageTag: "7.17.3"
roles:
   master: "false"
   ingest: "false"
   data: "true"
   remote_cluster_client: "true"
   ml: "false"
esJavaOpts: "-Xmx28g -Xms28g"
resources:
  requests:
    cpu: 15
    memory: "54Gi"
  limits:
    cpu: 15
    memory: "54Gi"
volumeClaimTemplate:
  accessModes: [ "ReadWriteOnce" ]
  storageClassName: premium-rwo
  resources:
    requests:
      storage: 200Gi
esConfig: 
  elasticsearch.yml: |
      node.attr.env: build
      xpack.monitoring.collection.enabled: false
      ingest.geoip.downloader.enabled: false
      indices.query.bool.max_clause_count: 100000
      indices.recovery.max_bytes_per_sec: 192mb
nodeAffinity:
  requiredDuringSchedulingIgnoredDuringExecution:
    nodeSelectorTerms:
      - matchExpressions:
        - key: cloud.google.com/gke-nodepool
          operator: In
          values:
            - elastic-build-pool
lifecycle:
  postStart:
    exec:
      command:
        - bash
        - -c
        - |
          #!/bin/bash
          while [[ "$(curl -s -o /dev/null -w '%{http_code}\n' http://localhost:9200)" != "200" ]]; do sleep 1; done
          curl -XPUT -H "Content-Type: application/json" --data '{"index_patterns": [".*.build,-.live*"],"settings" : {"index.routing.allocation.require.env": "build","number_of_replicas":0}}' http://localhost:9200/_template/build-template
          