ignore ServiceMonitor when monitoring is disabled

This commit is contained in:
Janikio 2021-10-03 18:35:04 +02:00
parent 1d2dfe593c
commit ca04c59ac9
No known key found for this signature in database
GPG key ID: 12FB1516BA8637D0
3 changed files with 6 additions and 0 deletions

View file

@ -1,4 +1,5 @@
{{- if .Values.filer.metricsPort }} {{- if .Values.filer.metricsPort }}
{{- if .Values.global.monitoring.enabled }}
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor kind: ServiceMonitor
metadata: metadata:
@ -15,4 +16,5 @@ spec:
selector: selector:
app: {{ template "seaweedfs.name" . }} app: {{ template "seaweedfs.name" . }}
component: filer component: filer
{{- end }}
{{- end }} {{- end }}

View file

@ -1,4 +1,5 @@
{{- if .Values.s3.metricsPort }} {{- if .Values.s3.metricsPort }}
{{- if .Values.global.monitoring.enabled }}
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor kind: ServiceMonitor
metadata: metadata:
@ -15,4 +16,5 @@ spec:
selector: selector:
app: {{ template "seaweedfs.name" . }} app: {{ template "seaweedfs.name" . }}
component: s3 component: s3
{{- end }}
{{- end }} {{- end }}

View file

@ -1,4 +1,5 @@
{{- if .Values.volume.metricsPort }} {{- if .Values.volume.metricsPort }}
{{- if .Values.global.monitoring.enabled }}
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor kind: ServiceMonitor
metadata: metadata:
@ -15,4 +16,5 @@ spec:
selector: selector:
app: {{ template "seaweedfs.name" . }} app: {{ template "seaweedfs.name" . }}
component: volume component: volume
{{- end }}
{{- end }} {{- end }}