2022-10-28 12:18:04 +02:00
|
|
|
{{- $redisHa := index .Values "redis-ha" -}}
|
2020-04-09 17:31:13 +01:00
|
|
|
{{- if and .Values.redis.enabled (not $redisHa.enabled) -}}
|
2019-11-04 16:17:25 -08:00
|
|
|
apiVersion: apps/v1
|
|
|
|
|
kind: Deployment
|
|
|
|
|
metadata:
|
2022-11-30 18:25:22 -05:00
|
|
|
{{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.redis.deploymentAnnotations) }}
|
|
|
|
|
annotations:
|
|
|
|
|
{{- range $key, $value := . }}
|
|
|
|
|
{{ $key }}: {{ $value | quote }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- end }}
|
2022-10-28 12:18:04 +02:00
|
|
|
name: {{ include "argo-cd.redis.fullname" . }}
|
2024-05-14 17:17:31 +02:00
|
|
|
namespace: {{ include "argo-cd.namespace" . }}
|
2019-11-04 16:17:25 -08:00
|
|
|
labels:
|
2021-03-22 21:15:37 +01:00
|
|
|
{{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 4 }}
|
2019-11-04 16:17:25 -08:00
|
|
|
spec:
|
2022-11-01 20:26:44 +01:00
|
|
|
replicas: 1
|
|
|
|
|
revisionHistoryLimit: {{ .Values.global.revisionHistoryLimit }}
|
2019-11-04 16:17:25 -08:00
|
|
|
selector:
|
|
|
|
|
matchLabels:
|
|
|
|
|
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.redis.name }}
|
|
|
|
|
template:
|
|
|
|
|
metadata:
|
2022-10-28 12:18:04 +02:00
|
|
|
labels:
|
|
|
|
|
{{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 8 }}
|
|
|
|
|
{{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.redis.podLabels) }}
|
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
|
{{- end }}
|
2021-09-15 19:30:54 +09:00
|
|
|
{{- with (mergeOverwrite (deepCopy .Values.global.podAnnotations) .Values.redis.podAnnotations) }}
|
2020-03-09 11:39:21 +01:00
|
|
|
annotations:
|
2022-01-31 20:26:04 +01:00
|
|
|
{{- range $key, $value := . }}
|
|
|
|
|
{{ $key }}: {{ $value | quote }}
|
|
|
|
|
{{- end }}
|
2020-03-09 11:39:21 +01:00
|
|
|
{{- end }}
|
2019-11-04 16:17:25 -08:00
|
|
|
spec:
|
2024-09-20 00:59:01 -07:00
|
|
|
{{- with .Values.redis.runtimeClassName | default .Values.global.runtimeClassName }}
|
|
|
|
|
runtimeClassName: {{ . }}
|
|
|
|
|
{{- end }}
|
2022-06-02 21:26:08 +09:00
|
|
|
{{- with .Values.redis.imagePullSecrets | default .Values.global.imagePullSecrets }}
|
2020-03-06 13:26:18 +03:00
|
|
|
imagePullSecrets:
|
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
|
{{- end }}
|
2023-02-23 19:11:54 +01:00
|
|
|
{{- with .Values.global.hostAliases }}
|
|
|
|
|
hostAliases:
|
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
|
{{- end }}
|
2022-10-28 12:18:04 +02:00
|
|
|
{{- with .Values.redis.securityContext }}
|
|
|
|
|
securityContext:
|
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
|
{{- end }}
|
2023-03-02 15:28:23 +01:00
|
|
|
{{- with .Values.redis.priorityClassName | default .Values.global.priorityClassName }}
|
|
|
|
|
priorityClassName: {{ . }}
|
|
|
|
|
{{- end }}
|
2023-10-27 18:43:52 +09:00
|
|
|
{{- if .Values.redis.terminationGracePeriodSeconds }}
|
|
|
|
|
terminationGracePeriodSeconds: {{ .Values.redis.terminationGracePeriodSeconds }}
|
|
|
|
|
{{- end }}
|
2024-01-05 13:56:59 +01:00
|
|
|
serviceAccountName: {{ include "argo-cd.redis.serviceAccountName" . }}
|
2024-04-10 23:05:47 +03:00
|
|
|
automountServiceAccountToken: {{ .Values.redis.automountServiceAccountToken }}
|
2019-11-04 16:17:25 -08:00
|
|
|
containers:
|
2022-10-28 12:18:04 +02:00
|
|
|
- name: {{ .Values.redis.name }}
|
|
|
|
|
image: {{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}
|
|
|
|
|
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.redis.image.imagePullPolicy }}
|
2019-11-04 16:17:25 -08:00
|
|
|
args:
|
2023-06-09 00:52:13 +02:00
|
|
|
{{- with .Values.redis.extraArgs }}
|
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
|
{{- end }}
|
2019-11-04 16:17:25 -08:00
|
|
|
- --save
|
|
|
|
|
- ""
|
|
|
|
|
- --appendonly
|
|
|
|
|
- "no"
|
2024-05-21 18:36:32 +02:00
|
|
|
- --requirepass $(REDIS_PASSWORD)
|
2019-12-06 00:50:47 +01:00
|
|
|
env:
|
2024-05-21 18:36:32 +02:00
|
|
|
- name: REDIS_PASSWORD
|
|
|
|
|
valueFrom:
|
|
|
|
|
secretKeyRef:
|
|
|
|
|
name: argocd-redis
|
|
|
|
|
key: auth
|
|
|
|
|
{{- with (concat .Values.global.env .Values.redis.env) }}
|
2022-10-28 12:18:04 +02:00
|
|
|
{{- toYaml . | nindent 8 }}
|
2021-05-21 18:43:24 +02:00
|
|
|
{{- end }}
|
|
|
|
|
{{- with .Values.redis.envFrom }}
|
2022-10-28 12:18:04 +02:00
|
|
|
envFrom:
|
|
|
|
|
{{- toYaml . | nindent 8 }}
|
2019-12-06 00:50:47 +01:00
|
|
|
{{- end }}
|
2024-02-06 14:11:23 +01:00
|
|
|
{{- if .Values.redis.livenessProbe.enabled }}
|
|
|
|
|
livenessProbe:
|
|
|
|
|
initialDelaySeconds: {{ .Values.redis.livenessProbe.initialDelaySeconds }}
|
|
|
|
|
periodSeconds: {{ .Values.redis.livenessProbe.periodSeconds }}
|
|
|
|
|
timeoutSeconds: {{ .Values.redis.livenessProbe.timeoutSeconds }}
|
|
|
|
|
successThreshold: {{ .Values.redis.livenessProbe.successThreshold }}
|
|
|
|
|
failureThreshold: {{ .Values.redis.livenessProbe.failureThreshold }}
|
|
|
|
|
exec:
|
|
|
|
|
command:
|
|
|
|
|
- sh
|
|
|
|
|
- -c
|
|
|
|
|
- /health/redis_liveness.sh
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- if .Values.redis.readinessProbe.enabled }}
|
|
|
|
|
readinessProbe:
|
|
|
|
|
initialDelaySeconds: {{ .Values.redis.readinessProbe.initialDelaySeconds }}
|
|
|
|
|
periodSeconds: {{ .Values.redis.readinessProbe.periodSeconds }}
|
|
|
|
|
timeoutSeconds: {{ .Values.redis.readinessProbe.timeoutSeconds }}
|
|
|
|
|
successThreshold: {{ .Values.redis.readinessProbe.successThreshold }}
|
|
|
|
|
failureThreshold: {{ .Values.redis.readinessProbe.failureThreshold }}
|
|
|
|
|
exec:
|
|
|
|
|
command:
|
|
|
|
|
- sh
|
|
|
|
|
- -c
|
|
|
|
|
- /health/redis_readiness.sh
|
|
|
|
|
{{- end }}
|
2019-11-04 16:17:25 -08:00
|
|
|
ports:
|
2022-10-28 12:18:04 +02:00
|
|
|
- name: redis
|
2023-01-21 13:07:14 +01:00
|
|
|
containerPort: {{ .Values.redis.containerPorts.redis }}
|
2022-10-28 12:18:04 +02:00
|
|
|
protocol: TCP
|
2019-11-04 16:17:25 -08:00
|
|
|
resources:
|
2022-10-28 12:18:04 +02:00
|
|
|
{{- toYaml .Values.redis.resources | nindent 10 }}
|
2023-05-23 22:29:26 +02:00
|
|
|
{{- with .Values.redis.containerSecurityContext }}
|
2022-10-28 12:18:04 +02:00
|
|
|
securityContext:
|
2023-05-23 22:29:26 +02:00
|
|
|
{{- toYaml . | nindent 10 }}
|
|
|
|
|
{{- end }}
|
2022-10-28 12:18:04 +02:00
|
|
|
volumeMounts:
|
2024-02-06 14:11:23 +01:00
|
|
|
- mountPath: /health
|
|
|
|
|
name: health
|
|
|
|
|
{{- with .Values.redis.volumeMounts }}
|
2022-10-28 12:18:04 +02:00
|
|
|
{{- toYaml . | nindent 10 }}
|
|
|
|
|
{{- end }}
|
2023-01-22 18:20:30 +01:00
|
|
|
{{- if .Values.redis.exporter.enabled }}
|
2021-09-17 19:47:11 +02:00
|
|
|
- name: metrics
|
2023-01-22 18:20:30 +01:00
|
|
|
image: {{ .Values.redis.exporter.image.repository }}:{{ .Values.redis.exporter.image.tag }}
|
|
|
|
|
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.redis.exporter.image.imagePullPolicy }}
|
2021-09-17 19:47:11 +02:00
|
|
|
env:
|
|
|
|
|
- name: REDIS_ADDR
|
2023-01-21 13:07:14 +01:00
|
|
|
value: {{ printf "redis://localhost:%v" .Values.redis.containerPorts.redis }}
|
2021-09-17 19:47:11 +02:00
|
|
|
- name: REDIS_EXPORTER_WEB_LISTEN_ADDRESS
|
2023-01-21 13:07:14 +01:00
|
|
|
value: {{ printf "0.0.0.0:%v" .Values.redis.containerPorts.metrics }}
|
2024-06-02 00:44:56 +01:00
|
|
|
- name: REDIS_PASSWORD
|
|
|
|
|
valueFrom:
|
|
|
|
|
secretKeyRef:
|
|
|
|
|
name: argocd-redis
|
|
|
|
|
key: auth
|
2023-06-07 16:52:02 +08:00
|
|
|
{{- with (concat .Values.global.env .Values.redis.exporter.env) }}
|
2023-03-09 13:05:01 +01:00
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
|
{{- end }}
|
2021-09-17 19:47:11 +02:00
|
|
|
ports:
|
2022-10-28 12:18:04 +02:00
|
|
|
- name: metrics
|
2023-01-21 13:07:14 +01:00
|
|
|
containerPort: {{ .Values.redis.containerPorts.metrics }}
|
2021-09-17 19:47:11 +02:00
|
|
|
protocol: TCP
|
2024-02-06 14:11:23 +01:00
|
|
|
{{- if .Values.redis.exporter.livenessProbe.enabled }}
|
|
|
|
|
livenessProbe:
|
|
|
|
|
httpGet:
|
|
|
|
|
path: /metrics
|
|
|
|
|
port: {{ .Values.redis.containerPorts.metrics }}
|
|
|
|
|
initialDelaySeconds: {{ .Values.redis.exporter.livenessProbe.initialDelaySeconds }}
|
|
|
|
|
timeoutSeconds: {{ .Values.redis.exporter.livenessProbe.timeoutSeconds }}
|
|
|
|
|
periodSeconds: {{ .Values.redis.exporter.livenessProbe.periodSeconds }}
|
|
|
|
|
successThreshold: {{ .Values.redis.exporter.livenessProbe.successThreshold }}
|
|
|
|
|
failureThreshold: {{ .Values.redis.exporter.livenessProbe.failureThreshold }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- if .Values.redis.exporter.readinessProbe.enabled }}
|
|
|
|
|
readinessProbe:
|
|
|
|
|
httpGet:
|
|
|
|
|
path: /metrics
|
|
|
|
|
port: {{ .Values.redis.containerPorts.metrics }}
|
|
|
|
|
initialDelaySeconds: {{ .Values.redis.exporter.readinessProbe.initialDelaySeconds }}
|
|
|
|
|
timeoutSeconds: {{ .Values.redis.exporter.readinessProbe.timeoutSeconds }}
|
|
|
|
|
periodSeconds: {{ .Values.redis.exporter.readinessProbe.periodSeconds }}
|
|
|
|
|
successThreshold: {{ .Values.redis.exporter.readinessProbe.successThreshold }}
|
|
|
|
|
failureThreshold: {{ .Values.redis.exporter.readinessProbe.failureThreshold }}
|
|
|
|
|
{{- end }}
|
2022-10-28 12:18:04 +02:00
|
|
|
resources:
|
2023-01-22 18:20:30 +01:00
|
|
|
{{- toYaml .Values.redis.exporter.resources | nindent 10 }}
|
2023-05-23 22:29:26 +02:00
|
|
|
{{- with .Values.redis.exporter.containerSecurityContext }}
|
2022-10-28 12:18:04 +02:00
|
|
|
securityContext:
|
2023-05-23 22:29:26 +02:00
|
|
|
{{- toYaml . | nindent 10 }}
|
|
|
|
|
{{- end }}
|
2021-09-17 19:47:11 +02:00
|
|
|
{{- end }}
|
2022-10-28 12:18:04 +02:00
|
|
|
{{- with .Values.redis.extraContainers }}
|
2023-01-10 13:31:57 +01:00
|
|
|
{{- tpl (toYaml .) $ | nindent 6 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- with .Values.redis.initContainers }}
|
|
|
|
|
initContainers:
|
|
|
|
|
{{- tpl (toYaml .) $ | nindent 6 }}
|
2022-10-28 12:18:04 +02:00
|
|
|
{{- end }}
|
2023-03-02 15:28:23 +01:00
|
|
|
{{- with .Values.redis.nodeSelector | default .Values.global.nodeSelector }}
|
2019-11-04 16:17:25 -08:00
|
|
|
nodeSelector:
|
2022-10-28 12:18:04 +02:00
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
|
{{- end }}
|
2023-03-02 15:28:23 +01:00
|
|
|
{{- with .Values.redis.tolerations | default .Values.global.tolerations }}
|
2019-11-04 16:17:25 -08:00
|
|
|
tolerations:
|
2022-10-28 12:18:04 +02:00
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
|
{{- end }}
|
2023-03-02 15:28:23 +01:00
|
|
|
{{- with include "argo-cd.affinity" (dict "context" . "component" .Values.redis) }}
|
2019-11-04 16:17:25 -08:00
|
|
|
affinity:
|
2023-03-02 15:28:23 +01:00
|
|
|
{{- trim . | nindent 8 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- with .Values.redis.topologySpreadConstraints | default .Values.global.topologySpreadConstraints }}
|
2021-09-17 15:57:26 +02:00
|
|
|
topologySpreadConstraints:
|
2022-10-28 12:18:04 +02:00
|
|
|
{{- range $constraint := . }}
|
2021-09-17 15:57:26 +02:00
|
|
|
- {{ toYaml $constraint | nindent 8 | trim }}
|
|
|
|
|
{{- if not $constraint.labelSelector }}
|
|
|
|
|
labelSelector:
|
|
|
|
|
matchLabels:
|
|
|
|
|
app.kubernetes.io/name: {{ include "argo-cd.name" $ }}-{{ $.Values.redis.name }}
|
|
|
|
|
{{- end }}
|
2022-10-28 12:18:04 +02:00
|
|
|
{{- end }}
|
|
|
|
|
{{- end }}
|
2019-11-04 16:17:25 -08:00
|
|
|
volumes:
|
2024-02-06 14:11:23 +01:00
|
|
|
- name: health
|
|
|
|
|
configMap:
|
|
|
|
|
name: {{ include "argo-cd.redis.fullname" . }}-health-configmap
|
2024-02-23 13:15:47 +01:00
|
|
|
defaultMode: 493
|
2024-02-06 14:11:23 +01:00
|
|
|
{{- with .Values.redis.volumes }}
|
2022-10-28 12:18:04 +02:00
|
|
|
{{- toYaml . | nindent 8}}
|
2021-11-29 10:50:39 +00:00
|
|
|
{{- end }}
|
2023-02-15 01:11:16 +01:00
|
|
|
{{- with .Values.redis.dnsConfig }}
|
|
|
|
|
dnsConfig:
|
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
dnsPolicy: {{ .Values.redis.dnsPolicy }}
|
2019-11-04 16:17:25 -08:00
|
|
|
{{- end }}
|