Skip to content

Commit 832767d

Browse files
committed
feat: Migrate redis to our own chart
1 parent 2c4c493 commit 832767d

6 files changed

Lines changed: 128 additions & 36 deletions

File tree

charts/plumber/Chart.lock

Lines changed: 0 additions & 6 deletions
This file was deleted.

charts/plumber/Chart.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: v2
22
name: plumber
33
description: Helm chart for Plumber
44
type: application
5-
version: "1.2.0"
6-
appVersion: "1.2.0"
5+
version: "1.3.0"
6+
appVersion: "1.3.0"
77
home: https://github.com/getplumber/platform/
88
maintainers:
99
- name: devpro
@@ -16,8 +16,3 @@ maintainers:
1616
email: thibaud@getplumber.io
1717
- name: Joseph94m
1818
email: joseph.moukarzel@jmclarity.com
19-
dependencies:
20-
- name: redis
21-
version: "~25"
22-
repository: https://charts.bitnami.com/bitnami
23-
condition: redis.deploy
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{/*
2+
Build the Redis image reference from values.
3+
Produces: [registry/]repository:tag[@digest]
4+
*/}}
5+
{{- define "plumber.redisImage" -}}
6+
{{- $reg := .Values.redis.image.registry -}}
7+
{{- $repo := .Values.redis.image.repository -}}
8+
{{- $tag := .Values.redis.image.tag -}}
9+
{{- $dig := .Values.redis.image.digest -}}
10+
{{- $base := ternary (printf "%s/%s" $reg $repo) $repo (ne $reg "") -}}
11+
{{- ternary (printf "%s:%s@%s" $base $tag $dig) (printf "%s:%s" $base $tag) (ne $dig "") -}}
12+
{{- end }}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{{- if .Values.redis.deploy }}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: {{ printf "%s-redis-master" .Release.Name }}
6+
labels:
7+
app: {{ printf "%s-redis-master" .Release.Name }}
8+
app.kubernetes.io/name: {{ printf "%s-redis-master" .Release.Name }}
9+
{{- range $key, $val := .Values.additionalLabels }}
10+
{{ $key }}: {{ $val | quote }}
11+
{{- end }}
12+
{{- with .Values.additionalAnnotations }}
13+
annotations:
14+
{{- range $key, $val := . }}
15+
{{ $key }}: {{ $val | quote }}
16+
{{- end }}
17+
{{- end }}
18+
spec:
19+
replicas: 1
20+
selector:
21+
matchLabels:
22+
app: {{ printf "%s-redis-master" .Release.Name }}
23+
app.kubernetes.io/name: {{ printf "%s-redis-master" .Release.Name }}
24+
template:
25+
metadata:
26+
labels:
27+
app: {{ printf "%s-redis-master" .Release.Name }}
28+
app.kubernetes.io/name: {{ printf "%s-redis-master" .Release.Name }}
29+
{{- range $key, $val := .Values.additionalLabels }}
30+
{{ $key }}: {{ $val | quote }}
31+
{{- end }}
32+
spec:
33+
{{- with .Values.imagePullSecrets }}
34+
imagePullSecrets:
35+
{{- toYaml . | nindent 8 }}
36+
{{- end }}
37+
containers:
38+
- name: redis
39+
image: {{ include "plumber.redisImage" . }}
40+
imagePullPolicy: {{ .Values.redis.image.pullPolicy | default "IfNotPresent" }}
41+
ports:
42+
- name: redis
43+
containerPort: 6379
44+
protocol: TCP
45+
{{- if or .Values.redis.auth.existingSecret .Values.redis.auth.password }}
46+
command: ["redis-server", "--requirepass", "$(REDIS_PASSWORD)"]
47+
env:
48+
- name: REDIS_PASSWORD
49+
{{- if .Values.redis.auth.existingSecret }}
50+
valueFrom:
51+
secretKeyRef:
52+
name: {{ .Values.redis.auth.existingSecret | quote }}
53+
key: {{ .Values.redis.auth.existingSecretPasswordKey | quote }}
54+
{{- else }}
55+
value: {{ .Values.redis.auth.password | quote }}
56+
{{- end }}
57+
{{- end }}
58+
livenessProbe:
59+
tcpSocket:
60+
port: redis
61+
initialDelaySeconds: 10
62+
periodSeconds: 30
63+
readinessProbe:
64+
tcpSocket:
65+
port: redis
66+
initialDelaySeconds: 5
67+
periodSeconds: 10
68+
resources: {}
69+
{{- end }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{- if .Values.redis.deploy }}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: {{ printf "%s-redis-master" .Release.Name }}
6+
labels:
7+
app: {{ printf "%s-redis-master" .Release.Name }}
8+
app.kubernetes.io/name: {{ printf "%s-redis-master" .Release.Name }}
9+
{{- range $key, $val := .Values.additionalLabels }}
10+
{{ $key }}: {{ $val | quote }}
11+
{{- end }}
12+
{{- with .Values.additionalAnnotations }}
13+
annotations:
14+
{{- range $key, $val := . }}
15+
{{ $key }}: {{ $val | quote }}
16+
{{- end }}
17+
{{- end }}
18+
spec:
19+
type: ClusterIP
20+
selector:
21+
app: {{ printf "%s-redis-master" .Release.Name }}
22+
app.kubernetes.io/name: {{ printf "%s-redis-master" .Release.Name }}
23+
ports:
24+
- name: redis
25+
port: 6379
26+
targetPort: redis
27+
protocol: TCP
28+
{{- end }}

charts/plumber/values.yaml

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -262,34 +262,28 @@ postgresql:
262262

263263
# Redis
264264
redis:
265-
# -- Set to true to deploy a Redis instance as part of this chart (via bitnami/redis sub-chart).
266-
# When false (default), Redis is treated as an external dependency and you must provide connection details below.
265+
# -- Set to true to deploy a Redis instance as part of this chart.
266+
# When false, Redis is treated as an external dependency provide connection details in custom below.
267267
deploy: false
268268

269-
# -- Redis architecture when deployed by this chart. Options: "standalone" or "replication".
270-
# Keep Standalone for now because we do not support replication yet.
271-
architecture: standalone
272-
273-
# Image configuration (only used when deploy is true).
274-
# Override these to pull from a private registry or mirror.
275-
# When using a non-bitnami registry, you must also set global.security.allowInsecureImages to true.
269+
# Image configuration for the bundled Redis instance (only used when deploy is true).
276270
image:
277-
# registry: my-private-registry.example.com
278-
# repository: bitnami/redis
279-
# tag: "latest"
280-
digest: "sha256:98cf67395e80506c7bc21b889107980365558ef30d59059ac6d76aab2678bf7e"
281-
# pullPolicy: IfNotPresent
282-
# pullSecrets:
283-
# - my-registry-secret
284-
285-
# Persistence for deployed Redis (only used when deploy is true).
286-
# Disabled by default — Redis is used as a cache/queue, data loss on restart is acceptable.
287-
master:
288-
persistence:
289-
enabled: false
271+
# -- Optional registry prefix (e.g. my-private-registry.example.com).
272+
# When set, the image is pulled as <registry>/<repository>:<tag>.
273+
# Leave empty to use repository as-is.
274+
registry: ""
275+
# -- Image repository. Override to pull from a mirror or private registry.
276+
repository: redis
277+
# -- Image tag.
278+
tag: "8.4"
279+
# -- Optional content-addressable digest (sha256:...).
280+
# When set, pins the exact image version regardless of tag.
281+
digest: ""
282+
# -- Pull policy for the Redis image.
283+
pullPolicy: IfNotPresent
290284

291285
# Connection details for the Redis instance (used whether deployed by this chart or external).
292-
# When deploy is true and custom.host is empty, the host defaults to the sub-chart's service (<release>-redis-master).
286+
# When deploy is true and custom.host is empty, the host defaults to <release>-redis-master.
293287
custom:
294288
host: ""
295289
user: "default"

0 commit comments

Comments
 (0)