apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "telegraf.fullname" . }}
  labels:
    app.kubernetes.io/name: {{ include "telegraf.name" . }}
    helm.sh/chart: {{ include "telegraf.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
  telegraf.conf: |+
    {{ template "global_tags" .Values.config.global_tags }}
    {{ template "agent" .Values.config.agent }}
    {{ template "processors" .Values.config.processors }}
    {{ template "outputs" .Values.config.outputs }}
    {{ template "inputs" .Values.config.inputs -}}
