Skip to content

Commit

Permalink
Merge pull request #239 from sergeunity/service-monitor-in-option
Browse files Browse the repository at this point in the history
Service monitor in option
  • Loading branch information
ese authored Feb 13, 2020
2 parents a569fb3 + f04d47b commit cc5f180
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/redisoperator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
description: A Helm chart for the Spotahome Redis Operator
name: redisoperator
version: 3.0.0
version: 3.1.0
8 changes: 7 additions & 1 deletion charts/redisoperator/templates/monitoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ metadata:
labels:
prometheus: {{ .Values.monitoring.prometheus.name }}
{{ include "helm-labels" . | indent 4 }}
{{- if .Values.monitoring.serviceAnnotations }}
annotations:
{{ toYaml .Values.monitoring.serviceAnnotations | indent 4 }}
{{- end }}
spec:
ports:
- port: 9710
Expand All @@ -16,7 +20,8 @@ spec:
{{ include "common-labels" . | indent 4 }}

---
apiVersion: monitoring.coreos.com/v1
{{- if .Values.monitoring.serviceMonitor -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "name" . }}
Expand All @@ -34,4 +39,5 @@ spec:
endpoints:
- port: metrics
interval: 15s
{{- end -}}
{{- end -}}
2 changes: 2 additions & 0 deletions charts/redisoperator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ rbac:
imagePullSecrets: []
monitoring:
enabled: false
serviceMonitor: false
serviceAnnotations: {}
prometheus:
name: unknown

0 comments on commit cc5f180

Please sign in to comment.