From bef01e96ab9c2b6f6c24411604f1a04af4ea7f89 Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Sat, 15 Aug 2020 14:45:43 +0100 Subject: [PATCH] Exlude stateuful service objects to prevent double scrapes --- charts/kubezero-logging/templates/servicemonitor.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/kubezero-logging/templates/servicemonitor.yaml b/charts/kubezero-logging/templates/servicemonitor.yaml index 007acc88..0ca55952 100644 --- a/charts/kubezero-logging/templates/servicemonitor.yaml +++ b/charts/kubezero-logging/templates/servicemonitor.yaml @@ -19,6 +19,9 @@ spec: port: http path: /_prometheus/metrics selector: + matchExpressions: + key: elasticsearch.k8s.elastic.co/statefulset-name + operator: DoesNotExist matchLabels: common.k8s.elastic.co/type: elasticsearch elasticsearch.k8s.elastic.co/cluster-name: {{ template "kubezero-lib.fullname" $ }}