apiVersion: v1
kind: ConfigMap
metadata:
  name: es-config
data:
  elasticsearch.yml: |-
    ---
    cluster:
      name: ${CLUSTER_NAME}

    node:
      master: ${NODE_MASTER}
      data: ${NODE_DATA}
      name: ${NODE_NAME}
      ingest: ${NODE_INGEST}
      max_local_storage_nodes: ${MAX_LOCAL_STORAGE_NODES}

    processors: ${PROCESSORS:1}

    network.host: ${NETWORK_HOST}

    path:
      data: /data/data
      logs: /data/log
      repo: ${REPO_LOCATIONS}

    bootstrap:
      memory_lock: ${MEMORY_LOCK}

    http:
      enabled: ${HTTP_ENABLE}
      compression: true
      cors:
        enabled: ${HTTP_CORS_ENABLE}
        allow-origin: ${HTTP_CORS_ALLOW_ORIGIN}

    discovery:
      zen:
        ping.unicast.hosts: ${DISCOVERY_SERVICE}
        minimum_master_nodes: ${NUMBER_OF_MASTERS}

    xpack:
      ml.enabled: false
      security.enabled: false

    reindex.remote.whitelist: ${REINDEX_REMOTE_WHITELIST}

    searchguard.enterprise_modules_enabled: false
    searchguard.ssl.transport.pemcert_filepath: node.pem
    searchguard.ssl.transport.pemkey_filepath: node.key
    searchguard.ssl.transport.pemtrustedcas_filepath: root-ca.pem
    searchguard.ssl.transport.enforce_hostname_verification: false
    searchguard.ssl.transport.resolve_hostname: false
    searchguard.ssl.http.enabled: false
    searchguard.nodes_dn:
    - CN=node.lionstep.com,OU=Ops,O=Lionstep\, Inc.,DC=lionstep,DC=com
    searchguard.authcz.admin_dn:
    - CN=pipeline.lionstep.com,OU=Ops,O=Lionstep\, Inc.,DC=lionstep,DC=com

  tlsconfig.yml: |-
    ---
    defaults:
      validityDays: 730
      pkPassword: none
      generatedPasswordLength: 12

    ca:
      root:
        dn: CN=root.ca.lionstep.com,OU=CA,O=Lionstep\, Inc.,DC=lionstep,DC=com
        keysize: 2048
        validityDays: 3650
        file: root-ca.pem

    nodes:
      - name: node
        dn: CN=node.lionstep.com,OU=Ops,O=Lionstep\, Inc.,DC=lionstep,DC=com

    clients:
      - name: app_engine
        dn: CN=app_engine.lionstep.com,OU=Ops,O=Lionstep\, Inc.,DC=lionstep,DC=com
      - name: pipeline
        dn: CN=pipeline.lionstep.com,OU=Ops,O=Lionstep\, Inc.,DC=lionstep,DC=com
        admin: true