Skip to content

Commit

Permalink
servicemonitor: crd judgement & changable label
Browse files Browse the repository at this point in the history
  • Loading branch information
djangoyi-yunify committed Nov 8, 2023
1 parent 9e10c89 commit 2bbf0bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions charts/open-mongodb/templates/monitor.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{ if .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" -}}
---
apiVersion: v1
data:
password: {{ .Values.prometheus.username }}
Expand All @@ -14,6 +16,9 @@ kind: ServiceMonitor
metadata:
labels:
app.kubernetes.io/vendor: kubesphere
{{- if .Values.serviceMonitor.labels }}
{{- toYaml .Values.serviceMonitor.labels | nindent 4 }}
{{- end }}
name: open-mongodb-metrics-monitor
namespace: {{ .Release.Namespace }}
spec:
Expand All @@ -35,3 +40,4 @@ spec:
selector:
matchLabels:
mongodbv2/exporter-monitor: "yes"
{{ end }}
3 changes: 3 additions & 0 deletions charts/open-mongodb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ securityContext: {}
nodeSelector: {}
tolerations: []
affinity: {}

serviceMonitor:
labels:

0 comments on commit 2bbf0bb

Please sign in to comment.