From 1817baccf1ad2afbcca3a6b5761b6bc2788858e4 Mon Sep 17 00:00:00 2001
From: paulfantom <pawel@krupa.net.pl>
Date: Sun, 7 Feb 2021 11:51:21 +0100
Subject: [PATCH] jsonnet: antiaffinity addon should also affect blackbox
 exporter

Signed-off-by: paulfantom <pawel@krupa.net.pl>
---
 .../addons/anti-affinity.libsonnet               | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/jsonnet/kube-prometheus/addons/anti-affinity.libsonnet b/jsonnet/kube-prometheus/addons/anti-affinity.libsonnet
index 014f32a9..3f55d268 100644
--- a/jsonnet/kube-prometheus/addons/anti-affinity.libsonnet
+++ b/jsonnet/kube-prometheus/addons/anti-affinity.libsonnet
@@ -22,17 +22,29 @@
     },
   },
 
-  alertmanager+:: {
+  alertmanager+: {
     alertmanager+: {
       spec+:
         antiaffinity('alertmanager', [$.values.alertmanager.name], $.values.common.namespace),
     },
   },
 
-  prometheus+:: {
+  prometheus+: {
     prometheus+: {
       spec+:
         antiaffinity('prometheus', [$.values.prometheus.name], $.values.common.namespace),
     },
   },
+
+  blackboxExporter+: {
+    deployment+: {
+      spec+: {
+        template+: {
+          spec+:
+            antiaffinity('app.kubernetes.io/name', ['blackbox-exporter'], $.values.common.namespace),
+        },
+      },
+    },
+  },
+
 }
-- 
GitLab