chore: build
ci-api / test (push) Successful in 23m32s
ci-web / test (push) Successful in 14m7s

This commit is contained in:
Xor290
2026-09-20 18:52:09 +02:00
parent 9e11f01c2c
commit 8d857faa45
66 changed files with 3673 additions and 1564 deletions
@@ -0,0 +1,20 @@
{{- define "redis.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-redis" .Release.Name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- define "redis.labels" -}}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
app.kubernetes.io/name: redis
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{- define "redis.selectorLabels" -}}
app.kubernetes.io/name: redis
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
@@ -0,0 +1,20 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "redis.fullname" . }}-config
labels:
{{- include "redis.labels" . | nindent 4 }}
data:
redis.conf: |
maxmemory {{ .Values.config.maxmemory }}
maxmemory-policy {{ .Values.config.maxmemoryPolicy }}
appendonly {{ .Values.config.appendonly }}
appendfsync {{ .Values.config.appendfsync }}
{{- if .Values.config.save }}
save {{ .Values.config.save }}
{{- else }}
save ""
{{- end }}
protected-mode no
loglevel notice
# Le mot de passe est injecté au démarrage via --requirepass
@@ -0,0 +1,17 @@
{{- if .Values.persistence.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "redis.fullname" . }}-data
labels:
{{- include "redis.labels" . | nindent 4 }}
spec:
accessModes:
- {{ .Values.persistence.accessMode }}
resources:
requests:
storage: {{ .Values.persistence.size }}
{{- if .Values.persistence.storageClass }}
storageClassName: {{ .Values.persistence.storageClass }}
{{- end }}
{{- end }}
@@ -0,0 +1,12 @@
{{- if not .Values.auth.password }}
{{- fail "auth.password is required (--set-string auth.password=...)" }}
{{- end }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "redis.fullname" . }}
labels:
{{- include "redis.labels" . | nindent 4 }}
type: Opaque
stringData:
REDIS_PASSWORD: {{ .Values.auth.password | quote }}
@@ -0,0 +1,31 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "redis.fullname" . }}
labels:
{{- include "redis.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
selector:
{{- include "redis.selectorLabels" . | nindent 4 }}
ports:
- name: redis
port: {{ .Values.service.port }}
targetPort: redis
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "redis.fullname" . }}-headless
labels:
{{- include "redis.labels" . | nindent 4 }}
spec:
type: ClusterIP
clusterIP: None
selector:
{{- include "redis.selectorLabels" . | nindent 4 }}
ports:
- name: redis
port: {{ .Values.service.port }}
targetPort: redis
@@ -0,0 +1,84 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "redis.fullname" . }}
labels:
{{- include "redis.labels" . | nindent 4 }}
spec:
serviceName: {{ include "redis.fullname" . }}-headless
replicas: 1
selector:
matchLabels:
{{- include "redis.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "redis.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: redis
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
ports:
- name: redis
containerPort: 6379
protocol: TCP
command:
- redis-server
- /etc/redis/redis.conf
- "--requirepass"
- "$(REDIS_PASSWORD)"
env:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "redis.fullname" . }}
key: REDIS_PASSWORD
volumeMounts:
- name: data
mountPath: /data
- name: config
mountPath: /etc/redis/redis.conf
subPath: redis.conf
- name: tmp
mountPath: /tmp
livenessProbe:
exec:
command:
- sh
- -c
- redis-cli --no-auth-warning -a $REDIS_PASSWORD ping | grep PONG
initialDelaySeconds: 15
periodSeconds: 10
failureThreshold: 6
readinessProbe:
exec:
command:
- sh
- -c
- redis-cli --no-auth-warning -a $REDIS_PASSWORD ping | grep PONG
initialDelaySeconds: 5
periodSeconds: 5
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ include "redis.fullname" . }}-data
{{- else }}
emptyDir: {}
{{- end }}
- name: config
configMap:
name: {{ include "redis.fullname" . }}-config
- name: tmp
emptyDir: {}