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