# Source: https://github.com/helm/charts/tree/master/stable/elasticsearch-curator

elasticsearch-curator:
  hooks:
    install: true
    upgrade: true

  cronjob:
    # At 01:00 every day
    schedule: "0 1 * * *"
    annotations: {}
    concurrencyPolicy: ""
    failedJobsHistoryLimit: ""
    successfulJobsHistoryLimit: ""

  dry-run: false

  configMaps:
    # Delete indices older than 7 days
    action_file_yml: |-
      ---
      actions:
        1:
          action: delete_indices
          description: "Clean up ES by deleting old kubernetes logs"
          options:
            timeout_override:
            continue_if_exception: False
            disable_action: False
            ignore_empty_list: True
          filters:
          - filtertype: age
            source: name
            direction: older
            timestring: '%Y.%m.%d'
            unit: days
            unit_count: 60
            field:
            stats_result:
            epoch:
            exclude: False
          - filtertype: pattern
            kind: prefix
            value: kubernetes
        2:
          action: delete_indices
          description: "Clean up ES by deleting old kraken metrics"
          options:
            timeout_override:
            continue_if_exception: False
            disable_action: False
            ignore_empty_list: True
          filters:
          - filtertype: age
            source: name
            direction: older
            timestring: '%Y.%m.%d'
            unit: days
            unit_count: 30
            field:
            stats_result:
            epoch:
            exclude: False
          - filtertype: pattern
            kind: prefix
            value: kraken-metrics
  #  Having config_yaml WILL override the other config
    config_yml: |-
      ---
      client:
        hosts:
          - search-metrics-production-c65mdhdibmbmkl4pfiqsj5yhmq.us-west-2.es.amazonaws.com
        port: 443
        url_prefix:
        use_ssl: True
        certificate:
        client_cert:
        client_key:
        ssl_no_validate: False
        http_auth:
        timeout: 30
        master_only: False
      logging:
        loglevel: INFO
        logfile:
        logformat: default
        blacklist: ['elasticsearch', 'urllib3']
