Skip to content

Commit 2edfd61

Browse files
etrip chart 0.9.5: redis configuration via mounted file
1 parent 1976483 commit 2edfd61

2 files changed

Lines changed: 36 additions & 4 deletions

File tree

charts/etrip/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v1
22
name: etrip
33
description: eTrip PHP Helm chart
44
type: application
5-
version: 0.9.4
6-
appVersion: 7.3.19
5+
version: 0.9.5
6+
appVersion: 7.3.20

charts/etrip/templates/redis-vanilla.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
{{- if and (or .Values.etrip.use_redis .Values.etripng.enabled) (eq .Values.etrip.redis_flavour "vanilla") -}}
2+
{{/* The config file, if required */}}
3+
{{- if .Values.redis.config }}
4+
apiVersion: v1
5+
kind: ConfigMap
6+
metadata:
7+
name: {{ .Release.Name }}-redis-config
8+
namespace: {{ .Release.Namespace }}
9+
labels:
10+
{{- include "labels" . | nindent 4 }}
11+
app.kubernetes.io/component: redis
12+
data:
13+
redis.conf: |-
14+
{{- range $key, $value := .Values.redis.config }}
15+
{{ $key }} {{ $value }}
16+
{{- end }}
17+
---
18+
{{- end }}
19+
{{/* The deployment */}}
220
apiVersion: apps/v1
321
kind: Deployment
422
metadata:
@@ -33,7 +51,7 @@ spec:
3351
command:
3452
- /bin/sh
3553
- -c
36-
- redis-server --bind 0.0.0.0 --requirepass $REDISCLI_AUTH {{ range $key, $value := .Values.redis.config }}--{{ $key }} {{ $value | quote }} {{ end }}
54+
- redis-server --bind 0.0.0.0 --requirepass $REDISCLI_AUTH {{ if .Values.redis.config }}/etc/redis/redis.conf{{ end }}
3755
image: {{ .Values.redis.image.name }}:{{ .Values.redis.image.tag }}
3856
imagePullPolicy: {{ .Values.redis.image.pullPolicy }}
3957
env:
@@ -48,6 +66,13 @@ spec:
4866
protocol: TCP
4967
resources:
5068
{{- toYaml .Values.resources.redis | nindent 10 }}
69+
# we mount the config file
70+
{{- if .Values.redis.config }}
71+
volumeMounts:
72+
- name: redis-config
73+
mountPath: /etc/redis
74+
readOnly: true
75+
{{- end }}
5176
{{- /* monitoring sidecar */}}
5277
{{- if .Values.redis.monitoring.enabled }}
5378
- name: redis-exporter
@@ -66,8 +91,14 @@ spec:
6691
resources:
6792
{{- toYaml .Values.resources.redis_monitor | nindent 10 }}
6893
{{- end }}
94+
{{- if .Values.redis.config }}
95+
volumes:
96+
- name: redis-config
97+
configMap:
98+
name: {{ .Release.Name }}-redis-config
99+
{{- end }}
69100
---
70-
# podMonitor
101+
{{/* The PodMonitor for Redis monitoring */}}
71102
{{- if .Values.redis.monitoring.enabled }}
72103
apiVersion: monitoring.coreos.com/v1
73104
kind: PodMonitor
@@ -89,6 +120,7 @@ spec:
89120
app.kubernetes.io/component: redis
90121
{{- end }}
91122
---
123+
{{/* The Service for Redis */}}
92124
apiVersion: v1
93125
kind: Service
94126
metadata:

0 commit comments

Comments
 (0)