Files
omnex/deploy/chart-vitrine/redis/templates/statefulset.yaml
T
Xor290 8d857faa45
ci-api / test (push) Successful in 23m32s
ci-web / test (push) Successful in 14m7s
chore: build
2026-09-20 18:52:09 +02:00

85 lines
2.5 KiB
YAML

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: {}