apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "elasticsearch-curator.fullname" . }}-config
  labels:
    app: {{ template "elasticsearch-curator.name" . }}
    chart: {{ template "elasticsearch-curator.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
data:
  action_file.yml: {{ toYaml .Values.configMaps.action_file_yml | indent 2 }}
  {{ if .Values.configMaps.config_yml }}
  config.yml: {{ toYaml .Values.configMaps.config_yml | indent 2 }}
  {{ else }}
  config.yml: |
    client:
      hosts: 
        - {{ range .Values.config.elasticsearch.hosts }} {{ . }} {{ end }}
      port: {{ .Values.config.elasticsearch.port }}
  {{ end }}
  