clusterName: "elasticsearch"
nodeGroup: "live"
replicas: 2
image: "us.gcr.io/yourpath/elastic/elasticsearch"
imageTag: "7.17.10"
roles:
   master: "false"
   ingest: "true"
   data: "true"
   remote_cluster_client: "true"
   ml: "false"
esJavaOpts: "-Xmx6g -Xms6g"
resources:
  requests:
    cpu: 4
    memory: "10Gi"
  limits:
    cpu: 6
    memory: "10Gi"
volumeClaimTemplate:
  accessModes: [ "ReadWriteOnce" ]
  storageClassName: premium-rwo
  resources:
    requests:
      storage: 40Gi
esConfig: 
  elasticsearch.yml: |
      node.attr.env: live
      xpack.monitoring.collection.enabled: false
      ingest.geoip.downloader.enabled: false
      indices.recovery.max_bytes_per_sec: 192mb
      indices.query.bool.max_clause_count: 10000
nodeAffinity:
  requiredDuringSchedulingIgnoredDuringExecution:
    nodeSelectorTerms:
      - matchExpressions:
        - key: cloud.google.com/gke-nodepool
          operator: In
          values:
            - elastic-live-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": [".live*"],"settings" : {"index.routing.allocation.require.env": "live","number_of_shards":1,"number_of_replicas":1}}' http://localhost:9200/_template/live-template