feat(argo-cd): Add ability to scrape redis metrics (#892)
* feat(argo-cd): Add ability to scrape redis metrics Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com> * Bump chart version Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
This commit is contained in:
parent
489443e387
commit
7477b33cba
7 changed files with 144 additions and 2 deletions
39
charts/argo-cd/templates/redis/servicemonitor.yaml
Normal file
39
charts/argo-cd/templates/redis/servicemonitor.yaml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{{- $redisHa := (index .Values "redis-ha") -}}
|
||||
{{- if and .Values.redis.enabled (not $redisHa.enabled) .Values.redis.metrics.enabled .Values.redis.metrics.serviceMonitor.enabled -}}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ template "argo-cd.redis.fullname" . }}
|
||||
{{- with .Values.redis.metrics.serviceMonitor.namespace }}
|
||||
namespace: {{ . }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 4 }}
|
||||
{{- with .Values.redis.metrics.serviceMonitor.selector }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.redis.metrics.serviceMonitor.additionalLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
endpoints:
|
||||
- port: {{ .Values.redis.metrics.service.portName }}
|
||||
{{- with .Values.redis.metrics.serviceMonitor.interval }}
|
||||
interval: {{ . }}
|
||||
{{- end }}
|
||||
path: /metrics
|
||||
{{- with .Values.redis.metrics.serviceMonitor.relabelings }}
|
||||
relabelings:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.redis.metrics.serviceMonitor.metricRelabelings }}
|
||||
metricRelabelings:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ .Release.Namespace }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 6 }}
|
||||
{{- end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue