From 7f543f2adb19528599d224132c8b1c7211e61121 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Henning?= <soeren.henning@email.uni-kiel.de>
Date: Mon, 25 Jul 2022 19:41:29 +0200
Subject: [PATCH] Make pod metadata/annotations configurable

---
 helm/templates/prometheus/prometheus.yaml          | 4 ++++
 helm/templates/theodolite/theodolite-operator.yaml | 4 ++++
 helm/values.yaml                                   | 3 +++
 3 files changed, 11 insertions(+)

diff --git a/helm/templates/prometheus/prometheus.yaml b/helm/templates/prometheus/prometheus.yaml
index 196d68487..b02798218 100644
--- a/helm/templates/prometheus/prometheus.yaml
+++ b/helm/templates/prometheus/prometheus.yaml
@@ -5,6 +5,10 @@ metadata:
   name: {{ template "theodolite.fullname" . }}-prometheus
 spec:
   serviceAccountName: {{ template "theodolite.fullname" . }}-prometheus
+  {{- with .Values.prometheus.podMetadata }}
+  podMetadata:
+    {{- toYaml . | nindent 8 }}
+  {{- end}}
   podMonitorSelector: {}
   serviceMonitorSelector: {}
   resources:
diff --git a/helm/templates/theodolite/theodolite-operator.yaml b/helm/templates/theodolite/theodolite-operator.yaml
index f2669686e..c8714fc32 100644
--- a/helm/templates/theodolite/theodolite-operator.yaml
+++ b/helm/templates/theodolite/theodolite-operator.yaml
@@ -12,6 +12,10 @@ spec:
     metadata:
       labels:
         app: {{ include "theodolite.fullname" . }}
+      {{- with .Values.operator.podAnnotations }}
+      annotations:
+      {{ toYaml . | indent 2 }}
+      {{- end }}
     spec:
       terminationGracePeriodSeconds: 0
       serviceAccountName:  {{ include "theodolite.serviceAccountName" . }}
diff --git a/helm/values.yaml b/helm/values.yaml
index ec004607b..1fe1938b9 100644
--- a/helm/values.yaml
+++ b/helm/values.yaml
@@ -285,6 +285,7 @@ kube-prometheus-stack:
 ###
 prometheus: 
   enabled: true
+  podMetadata: {}
   nodeSelector: {}
   
   serviceAccount:
@@ -306,6 +307,8 @@ operator:
 
   nodeSelector: {}
 
+  podAnnotations: {}
+
   sloChecker:
     generic:
       enabled: true
-- 
GitLab