Skip to content

Commit 6e8d62e

Browse files
Have one podmonitor per shard
Issue: ZENKO-4641
1 parent 25d67b0 commit 6e8d62e

File tree

3 files changed

+7
-23
lines changed

3 files changed

+7
-23
lines changed

solution-base/mongodb/charts/mongodb-sharded/templates/shard/shard-data-podmonitor.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ SPDX-License-Identifier: APACHE-2.0
44
*/}}
55

66
{{- if and .Values.shards .Values.metrics.enabled .Values.metrics.podMonitor.enabled }}
7-
{{- $i := 0 }}
7+
{{- $replicas := .Values.shards | int }}
8+
{{- range $i, $e := until $replicas }}
89
apiVersion: monitoring.coreos.com/v1
910
kind: PodMonitor
1011
metadata:
@@ -35,4 +36,9 @@ spec:
3536
selector:
3637
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
3738
app.kubernetes.io/component: shardsvr
39+
shard: {{ $i | quote }}
40+
{{- if lt $i (sub $replicas 1) }}
41+
---
42+
{{- end }}
43+
{{- end }}
3844
{{- end }}

solution-base/mongodb/patches/mongodb-sharded-fix-podmonitor.patch

Lines changed: 0 additions & 22 deletions
This file was deleted.

solution-base/mongodb/patches/shard-data-podmonitor.patch

Whitespace-only changes.

0 commit comments

Comments
 (0)