Skip to content

Commit

Permalink
Have one podmonitor per shard
Browse files Browse the repository at this point in the history
Issue: ZENKO-4641
  • Loading branch information
williamlardier committed Jan 3, 2025
1 parent 25d67b0 commit 6e8d62e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ SPDX-License-Identifier: APACHE-2.0
*/}}

{{- if and .Values.shards .Values.metrics.enabled .Values.metrics.podMonitor.enabled }}
{{- $i := 0 }}
{{- $replicas := .Values.shards | int }}
{{- range $i, $e := until $replicas }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
Expand Down Expand Up @@ -35,4 +36,9 @@ spec:
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: shardsvr
shard: {{ $i | quote }}
{{- if lt $i (sub $replicas 1) }}
---
{{- end }}
{{- end }}
{{- end }}
22 changes: 0 additions & 22 deletions solution-base/mongodb/patches/mongodb-sharded-fix-podmonitor.patch

This file was deleted.

Empty file.

0 comments on commit 6e8d62e

Please sign in to comment.