2020-04-09 17:31:13 +01:00
|
|
|
{{- $redisHa := (index .Values "redis-ha") -}}
|
|
|
|
|
{{- if and .Values.redis.enabled (not $redisHa.enabled) -}}
|
2019-11-04 16:17:25 -08:00
|
|
|
apiVersion: apps/v1
|
|
|
|
|
kind: Deployment
|
|
|
|
|
metadata:
|
|
|
|
|
name: {{ template "argo-cd.redis.fullname" . }}
|
|
|
|
|
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 }}
|
2021-01-22 20:23:36 +09:00
|
|
|
app.kubernetes.io/version: {{ .Values.redis.image.tag | quote }}
|
2019-11-04 16:17:25 -08:00
|
|
|
spec:
|
|
|
|
|
selector:
|
|
|
|
|
matchLabels:
|
|
|
|
|
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.redis.name }}
|
|
|
|
|
template:
|
|
|
|
|
metadata:
|
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
|
|
|
labels:
|
2021-03-22 21:15:37 +01:00
|
|
|
{{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 8 }}
|
2021-01-22 20:23:36 +09:00
|
|
|
app.kubernetes.io/version: {{ .Values.redis.image.tag | quote }}
|
2021-09-15 19:30:54 +09:00
|
|
|
{{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.redis.podLabels) }}
|
2021-08-24 14:48:03 +02:00
|
|
|
{{- toYaml . | nindent 8 }}
|
2020-03-09 11:39:21 +01:00
|
|
|
{{- end }}
|
2019-11-04 16:17:25 -08:00
|
|
|
spec:
|
2020-03-06 13:26:18 +03:00
|
|
|
{{- with .Values.global.imagePullSecrets }}
|
|
|
|
|
imagePullSecrets:
|
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
|
{{- end }}
|
2021-07-12 13:06:50 +02:00
|
|
|
automountServiceAccountToken: {{ .Values.redis.serviceAccount.automountServiceAccountToken }}
|
|
|
|
|
serviceAccountName: {{ template "argo-cd.redisServiceAccountName" . }}
|
2020-07-15 19:18:47 +02:00
|
|
|
{{- if .Values.redis.securityContext }}
|
|
|
|
|
securityContext: {{- toYaml .Values.redis.securityContext | nindent 8 }}
|
2019-12-16 03:55:09 +01:00
|
|
|
{{- end }}
|
2019-11-04 16:17:25 -08:00
|
|
|
containers:
|
|
|
|
|
- name: {{ template "argo-cd.redis.fullname" . }}
|
|
|
|
|
args:
|
|
|
|
|
- --save
|
|
|
|
|
- ""
|
|
|
|
|
- --appendonly
|
|
|
|
|
- "no"
|
2021-04-24 12:50:25 +02:00
|
|
|
{{- with .Values.redis.extraArgs }}
|
|
|
|
|
{{- . | toYaml | nindent 8 }}
|
|
|
|
|
{{- end }}
|
2019-11-04 16:17:25 -08:00
|
|
|
image: {{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}
|
|
|
|
|
imagePullPolicy: {{ .Values.redis.image.imagePullPolicy}}
|
2020-01-13 06:18:35 +01:00
|
|
|
{{- if .Values.redis.containerSecurityContext }}
|
|
|
|
|
securityContext: {{- toYaml .Values.redis.containerSecurityContext | nindent 10 }}
|
2021-04-24 12:50:25 +02:00
|
|
|
{{- end }}
|
2019-12-06 00:50:47 +01:00
|
|
|
{{- if .Values.redis.env }}
|
|
|
|
|
env:
|
|
|
|
|
{{- toYaml .Values.redis.env | nindent 8 }}
|
2021-05-21 18:43:24 +02:00
|
|
|
{{- end }}
|
|
|
|
|
{{- with .Values.redis.envFrom }}
|
|
|
|
|
envFrom: {{- toYaml . | nindent 8 }}
|
2019-12-06 00:50:47 +01:00
|
|
|
{{- end }}
|
2019-11-04 16:17:25 -08:00
|
|
|
ports:
|
|
|
|
|
- containerPort: {{ .Values.redis.containerPort }}
|
2021-07-13 08:35:25 +02:00
|
|
|
name: redis
|
2019-11-04 16:17:25 -08:00
|
|
|
{{- if .Values.redis.volumeMounts }}
|
|
|
|
|
volumeMounts:
|
|
|
|
|
{{- toYaml .Values.redis.volumeMounts | nindent 10 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
resources:
|
|
|
|
|
{{- toYaml .Values.redis.resources | nindent 10 }}
|
2021-09-17 19:47:11 +02:00
|
|
|
{{- if .Values.redis.metrics.enabled }}
|
|
|
|
|
- name: metrics
|
|
|
|
|
env:
|
|
|
|
|
- name: REDIS_ADDR
|
|
|
|
|
value: {{ printf "redis://localhost:%v" .Values.redis.containerPort }}
|
|
|
|
|
- name: REDIS_EXPORTER_WEB_LISTEN_ADDRESS
|
|
|
|
|
value: {{ printf "0.0.0.0:%v" .Values.redis.metrics.containerPort }}
|
|
|
|
|
image: {{ .Values.redis.metrics.image.repository }}:{{ .Values.redis.metrics.image.tag }}
|
|
|
|
|
imagePullPolicy: {{ .Values.redis.metrics.image.imagePullPolicy}}
|
|
|
|
|
ports:
|
|
|
|
|
- containerPort: {{ .Values.redis.metrics.containerPort }}
|
|
|
|
|
name: metrics
|
|
|
|
|
protocol: TCP
|
|
|
|
|
resources: {{- toYaml .Values.redis.metrics.resources | nindent 10 }}
|
|
|
|
|
{{- with .Values.redis.containerSecurityContext }}
|
|
|
|
|
securityContext: {{- toYaml . | nindent 10 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- end }}
|
2021-09-17 02:59:20 +09:00
|
|
|
{{- with .Values.redis.extraContainers }}
|
|
|
|
|
{{- toYaml . | nindent 6 }}
|
|
|
|
|
{{- end }}
|
2019-11-04 16:17:25 -08:00
|
|
|
{{- if .Values.redis.nodeSelector }}
|
|
|
|
|
nodeSelector:
|
|
|
|
|
{{- toYaml .Values.redis.nodeSelector | nindent 8 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- if .Values.redis.tolerations }}
|
|
|
|
|
tolerations:
|
|
|
|
|
{{- toYaml .Values.redis.tolerations | nindent 8 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- if .Values.redis.affinity }}
|
|
|
|
|
affinity:
|
|
|
|
|
{{- toYaml .Values.redis.affinity | nindent 8 }}
|
|
|
|
|
{{- end }}
|
2021-09-17 15:57:26 +02:00
|
|
|
{{- with .Values.redis.topologySpreadConstraints }}
|
|
|
|
|
topologySpreadConstraints:
|
|
|
|
|
{{- range $constraint := . }}
|
|
|
|
|
- {{ toYaml $constraint | nindent 8 | trim }}
|
|
|
|
|
{{- if not $constraint.labelSelector }}
|
|
|
|
|
labelSelector:
|
|
|
|
|
matchLabels:
|
|
|
|
|
app.kubernetes.io/name: {{ include "argo-cd.name" $ }}-{{ $.Values.redis.name }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- end }}
|
2019-11-04 16:17:25 -08:00
|
|
|
{{- if .Values.redis.volumes }}
|
|
|
|
|
volumes:
|
|
|
|
|
{{- toYaml .Values.redis.volumes | nindent 8}}
|
|
|
|
|
{{- end }}
|
2021-11-29 10:50:39 +00:00
|
|
|
{{- if .Values.redis.initContainers }}
|
|
|
|
|
initContainers:
|
|
|
|
|
{{- toYaml .Values.redis.initContainers | nindent 6 }}
|
|
|
|
|
{{- end }}
|
2020-07-11 13:00:29 -04:00
|
|
|
{{- if .Values.redis.priorityClassName }}
|
|
|
|
|
priorityClassName: {{ .Values.redis.priorityClassName }}
|
|
|
|
|
{{- end }}
|
2019-11-04 16:17:25 -08:00
|
|
|
{{- end }}
|