Skip to content

Commit 0e2d55c

Browse files
committed
chore(valkey): add redis_exporter
1 parent 657b28c commit 0e2d55c

3 files changed

Lines changed: 60 additions & 5 deletions

File tree

charts/valkey/templates/valkey-statefulset.yaml

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ spec:
2222
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset.type "component" "" "extraMatchLabels" .Values.podAntiAffinityPreset.extraMatchLabels "topologyKey" "" "context" $) | nindent 10 }}
2323
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values ) | nindent 10 }}
2424
containers:
25-
- name: proxy
25+
- name: drycc-valkey-proxy
2626
image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/valkey:{{ .Values.imageTag }}
2727
imagePullPolicy: {{ .Values.imagePullPolicy }}
2828
{{- if .Values.diagnosticMode.enabled }}
@@ -71,7 +71,7 @@ spec:
7171
failureThreshold: 5
7272
tcpSocket:
7373
port: 16379
74-
- name: server
74+
- name: drycc-valkey-server
7575
image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/valkey:{{ .Values.imageTag }}
7676
imagePullPolicy: {{ .Values.imagePullPolicy }}
7777
{{- if .Values.diagnosticMode.enabled }}
@@ -146,7 +146,7 @@ spec:
146146
- /bin/bash
147147
- -c
148148
- /scripts/prestop-valkey.sh
149-
- name: sentinel
149+
- name: drycc-valkey-sentinel
150150
image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/valkey:{{ .Values.imageTag }}
151151
imagePullPolicy: {{ .Values.imagePullPolicy }}
152152
{{- if .Values.diagnosticMode.enabled }}
@@ -221,6 +221,52 @@ spec:
221221
- /bin/bash
222222
- -c
223223
- /scripts/prestop-sentinel.sh
224+
- name: drycc-valkey-metrics
225+
image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/valkey:{{ .Values.imageTag }}
226+
imagePullPolicy: {{ .Values.imagePullPolicy }}
227+
{{- if .Values.diagnosticMode.enabled }}
228+
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 10 }}
229+
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 10 }}
230+
{{- else }}
231+
command:
232+
- init-stack
233+
args:
234+
- redis_exporter
235+
{{- end }}
236+
ports:
237+
- containerPort: 9121
238+
env:
239+
- name: REDIS_PASSWORD
240+
valueFrom:
241+
secretKeyRef:
242+
name: valkey-creds
243+
key: password
244+
startupProbe:
245+
initialDelaySeconds: 10
246+
tcpSocket:
247+
port: 9121
248+
periodSeconds: 10
249+
timeoutSeconds: 1
250+
failureThreshold: 15
251+
successThreshold: 1
252+
livenessProbe:
253+
initialDelaySeconds: 5
254+
httpGet:
255+
path: /
256+
port: 9121
257+
periodSeconds: 10
258+
timeoutSeconds: 5
259+
failureThreshold: 6
260+
successThreshold: 1
261+
readinessProbe:
262+
initialDelaySeconds: 5
263+
httpGet:
264+
path: /
265+
port: 9121
266+
periodSeconds: 10
267+
timeoutSeconds: 5
268+
failureThreshold: 6
269+
successThreshold: 1
224270
securityContext:
225271
fsGroup: 1001
226272
runAsGroup: 1001

charts/valkey/templates/valkey-svc.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ kind: Service
33
metadata:
44
name: drycc-valkey
55
annotations:
6+
prometheus.io/path: /metrics
7+
prometheus.io/port: "9121"
8+
prometheus.io/scrape: "true"
69
{{- with .Values.service.annotations }}
710
{{- toYaml . | nindent 4 }}
811
{{- end }}
@@ -20,6 +23,10 @@ spec:
2023
port: 6379
2124
targetPort: 6379
2225
protocol: TCP
26+
- name: metrics
27+
port: 9121
28+
targetPort: 9121
29+
protocol: TCP
2330
- name: sentinel
2431
port: 26379
2532
targetPort: 26379

rootfs/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ ENV DRYCC_UID=1001 \
55
DRYCC_GID=1001 \
66
DRYCC_HOME_DIR=/data \
77
VALKEY_VERSION="8.1.1" \
8-
VALKEY_SENTINEL_PROXY_VERSION="1.0.2"
8+
VALKEY_SENTINEL_PROXY_VERSION="1.0.2" \
9+
REDIS_EXPORTER_VERSION="1.51.0"
910

1011
RUN groupadd drycc --gid ${DRYCC_GID} \
1112
&& useradd drycc -u ${DRYCC_UID} -g ${DRYCC_GID} -s /bin/bash -m -d ${DRYCC_HOME_DIR}
@@ -16,6 +17,7 @@ COPY bin/valkey-start /bin/valkey-start
1617

1718
RUN install-stack valkey ${VALKEY_VERSION} \
1819
&& install-stack valkey-sentinel-proxy ${VALKEY_SENTINEL_PROXY_VERSION} \
20+
&& install-stack redis_exporter $REDIS_EXPORTER_VERSION \
1921
&& rm -rf \
2022
/usr/share/doc \
2123
/usr/share/man \
@@ -34,4 +36,4 @@ RUN install-stack valkey ${VALKEY_VERSION} \
3436

3537
USER ${DRYCC_UID}
3638
WORKDIR ${DRYCC_HOME_DIR}
37-
EXPOSE 6379 26379
39+
EXPOSE 6379 9121 26379

0 commit comments

Comments
 (0)