Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #11 from v0112358/add_sidecart_redis_exporter
Browse files Browse the repository at this point in the history
Add sidecar redis exporter
  • Loading branch information
Antiarchitect authored Jun 29, 2020
2 parents a97c4f3 + fa8e669 commit 9258a0f
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
33 changes: 33 additions & 0 deletions keydb/templates/sts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ spec:
metadata:
annotations:
checksum/secret-utils: {{ include (print $.Template.BasePath "/secret-utils.yaml") . | sha256sum }}
{{- if .Values.exporter.enabled }}
prometheus.io/port: "{{ .Values.exporter.port }}"
prometheus.io/scrape: "{{ .Values.exporter.scrape }}"
prometheus.io/path: "{{ .Values.exporter.scrapePath }}"
{{- end }}
labels:
{{ include "keydb.labels" . | indent 8 }}
spec:
Expand Down Expand Up @@ -62,6 +67,34 @@ spec:
- name: utils
mountPath: /utils
readOnly: true
{{- if .Values.exporter.enabled }}
- name: redis-exporter
image: "{{ .Values.exporter.image }}:{{ .Values.exporter.tag }}"
imagePullPolicy: {{ .Values.exporter.pullPolicy }}
args:
{{- range $key, $value := .Values.exporter.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
env:
- name: REDIS_ADDR
value: redis://{{ default "localhost" .Values.exporter.address }}:{{ .Values.port }}
{{- if .Values.password }}
- name: REDIS_PASSWORD
value: "{{ .Values.password }}"
{{- end }}
livenessProbe:
httpGet:
path: {{ .Values.exporter.scrapePath }}
port: {{ .Values.exporter.port }}
initialDelaySeconds: 10
timeoutSeconds: 1
periodSeconds: 15
resources:
{{ toYaml .Values.exporter.resources | indent 10 }}
ports:
- name: redis-exporter
containerPort: {{ .Values.exporter.port }}
{{- end }}
securityContext:
{{ toYaml .Values.securityContext | indent 8 }}
volumes:
Expand Down
21 changes: 21 additions & 0 deletions keydb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,24 @@ readinessProbe:
tcpSocket:
port: keydb
initialDelaySeconds: 10

# Redis exporter
exporter:
enabled: true
image: oliver006/redis_exporter
tag: v1.8.0-alpine
pullPolicy: IfNotPresent

# prometheus port & scrape path
scrape: true
port: 9121
scrapePath: /metrics

# Address/Host for Redis instance.
address: localhost

# cpu/memory resource limits/requests
resources: {}

# Additional args for redis exporter
extraArgs: {}

0 comments on commit 9258a0f

Please sign in to comment.