Files
helm-charts/charts/redis-replication/templates/service-monitor.yaml
Alex Lebens 510c575424
All checks were successful
renovate / renovate (push) Successful in 29s
lint-and-test / lint-helm (push) Successful in 9s
release-charts-redis-replication / release (push) Successful in 17s
lint-and-test / chart-testing (push) Successful in 24s
enable on enable
2025-12-15 00:05:10 -06:00

50 lines
1.7 KiB
YAML

{{- if .Values.redisReplication.redisExporter.serviceMonitor.enabled }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "redis.replicationName" . }}
namespace: {{ include "redis.namespace" . }}
labels:
{{- include "redis.labels" . | nindent 4 }}
{{- include "redis.replicationSelectorLabels" . | nindent 4 }}
{{- with .Values.redisReplication.redisExporter.serviceMonitor.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
app: {{ include "redis.replicationName" . }}
redis_setup_type: replication
role: replication
endpoints:
- port: redis-exporter
interval: {{ .Values.redisReplication.redisExporter.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.redisReplication.redisExporter.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- if and (.Values.redisSentinel.redisExporter.serviceMonitor.enabled) (.Values.redisSentinel.enabled) }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "redis.sentinelName" . }}
namespace: {{ include "redis.namespace" . }}
labels:
{{- include "redis.labels" . | nindent 4 }}
{{- include "redis.sentinelSelectorLabels" . | nindent 4 }}
{{- with .Values.redisSentinel.redisExporter.serviceMonitor.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
app: {{ include "redis.sentinelName" . }}
redis_setup_type: sentinel
role: sentinel
endpoints:
- port: sentinel-client
interval: {{ .Values.redisSentinel.redisExporter.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.redisSentinel.redisExporter.serviceMonitor.scrapeTimeout }}
{{- end }}