diff --git a/charts/redis-sentinel/Chart.yaml b/charts/redis-sentinel/Chart.yaml index 6959e0f45..b0192e3a8 100644 --- a/charts/redis-sentinel/Chart.yaml +++ b/charts/redis-sentinel/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 name: redis-sentinel description: Provides easy redis setup definitions for Kubernetes services, and deployment. -version: 0.16.3 -appVersion: "0.16.3" +version: 0.16.4 +appVersion: "0.16.4" home: https://github.com/ot-container-kit/redis-operator sources: - https://github.com/ot-container-kit/redis-operator diff --git a/charts/redis-sentinel/templates/servicemonitor.yaml b/charts/redis-sentinel/templates/servicemonitor.yaml new file mode 100644 index 000000000..401e223e4 --- /dev/null +++ b/charts/redis-sentinel/templates/servicemonitor.yaml @@ -0,0 +1,27 @@ +{{- if eq .Values.serviceMonitor.enabled true }} +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ .Values.redisSentinel.name | default .Release.Name }}-prometheus-monitoring + labels: + app.kubernetes.io/name: {{ .Values.redisSentinel.name | default .Release.Name }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Values.redisSentinel.name | default .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: middleware +spec: + selector: + matchLabels: + app: {{ .Values.redisSentinel.name | default .Release.Name }} + redis_setup_type: sentinel + role: sentinel + endpoints: + - port: redis-exporter + interval: {{ .Values.serviceMonitor.interval }} + scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }} + namespaceSelector: + matchNames: + - {{ .Values.serviceMonitor.namespace }} +{{- end }}