apiVersion: v1
kind: ConfigMap
metadata:
  name: elastalert-configmap
data:
  config.yaml: |
    # will then use https
    use_ssl: {{ .Values.elastalert.elasticsearch.useSsl }}

    verify_certs: {{ .Values.elastalert.elasticsearch.verifyCerts }}

    # The elasticsearch hostname for metadata writeback
    # Note that every rule can have its own elasticsearch host
    es_host: {{ .Values.elastalert.elasticsearch.host }}

    # The elasticsearch port
    es_port: {{ .Values.elastalert.elasticsearch.port }}

    # The index on es_host which is used for metadata storage
    # This can be a unmapped index, but it is recommended that you run
    # elastalert-create-index to set a mapping
    writeback_index: elastalert_status

    # This is the folder that contains the rule yaml files
    # Any .yaml file will be loaded as a rule
    rules_folder: rules

    # Must be false to work in kubernetes
    scan_subdirectories: false

    # How often ElastAlert will query elasticsearch
    # The unit can be anything from weeks to seconds
    run_every:
      hours: 12

    # ElastAlert will buffer results from the most recent
    # period of time, in case some log sources are not in real time
    buffer_time:
      hours: 6

    smtp_host: {{ .Values.smtp.host }}
    # the TLS port
    smtp_port: {{ .Values.smtp.port }}
    # will use TLS if this is true, NOT SSL
    smtp_ssl : {{ .Values.smtp.useTLS }}
    from_addr: {{ .Values.smtp.fromAddress }}
    smtp_auth_file: "/tmp/smtp/smtp_auth.yaml"
