From 7e055479d6b22dda1ebdf8e687f7fc8fc7654a3e Mon Sep 17 00:00:00 2001
From: Robert Nemeti <nrobert13@gmail.com>
Date: Wed, 12 Dec 2018 16:17:17 +0000
Subject: [PATCH] add namespace to the component selectors

in order to select the right components in case multiple operators are running in the same cluster
---
 jsonnet/kube-prometheus/kube-prometheus.libsonnet | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/jsonnet/kube-prometheus/kube-prometheus.libsonnet b/jsonnet/kube-prometheus/kube-prometheus.libsonnet
index f59cc80f..8f8bbf02 100644
--- a/jsonnet/kube-prometheus/kube-prometheus.libsonnet
+++ b/jsonnet/kube-prometheus/kube-prometheus.libsonnet
@@ -32,9 +32,9 @@ local configMapList = k.core.v1.configMapList;
     coreDNSSelector: 'job="kube-dns"',
     podLabel: 'pod',
 
-    alertmanagerSelector: 'job="alertmanager-main"',
-    prometheusSelector: 'job="prometheus-k8s"',
-    prometheusOperatorSelector: 'job="prometheus-operator"',
+    alertmanagerSelector: 'job="alertmanager-main",namespace="' + $._config.namespace + '"',
+    prometheusSelector: 'job="prometheus-' + $._config.prometheus.name + '",namespace="' + $._config.namespace + '"',
+    prometheusOperatorSelector: 'job="prometheus-operator",namespace="' + $._config.namespace + '"',
 
     jobs: {
       Kubelet: $._config.kubeletSelector,
-- 
GitLab