diff --git a/charts/kafka-exporter/templates/deployment.yaml b/charts/kafka-exporter/templates/deployment.yaml index e2449a2d..ff474d45 100644 --- a/charts/kafka-exporter/templates/deployment.yaml +++ b/charts/kafka-exporter/templates/deployment.yaml @@ -18,8 +18,12 @@ spec: app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: - {{- if eq .Values.datadog.use_datadog true }} + {{- if or (eq .Values.datadog.use_datadog true) (.Values.podAnnotations) }} annotations: + {{- if .Values.podAnnotations }} + {{- .Values.podAnnotations | toYaml | nindent 8 }} + {{- end }} + {{- if eq .Values.datadog.use_datadog true }} ad.datadoghq.com/{{ .Chart.Name }}.check_names: | ["openmetrics"] ad.datadoghq.com/{{ .Chart.Name }}.init_configs: | @@ -32,6 +36,7 @@ spec: "metrics": {{ .Values.datadog.metrics | toJson | nindent 16 -}} } ] + {{- end }} {{- end }} labels: app.kubernetes.io/name: {{ include "kafka-exporter.name" . }} diff --git a/charts/kafka-exporter/values.yaml b/charts/kafka-exporter/values.yaml index 6af50b12..ab744149 100644 --- a/charts/kafka-exporter/values.yaml +++ b/charts/kafka-exporter/values.yaml @@ -51,6 +51,7 @@ prometheus: labels: {} podLabels: {} +podAnnotations: {} # Adds in Datadog annotations needed to scrape the prometheus endpoint. # prefix is required. If added, will provide a metric such as test.kafka_brokers.