argocd-helm/charts/argo-cd/templates/redis/deployment.yaml

221 lines
8.9 KiB
YAML
Raw Permalink Normal View History

{{- $redisHa := index .Values "redis-ha" -}}
feat: argo-cd can deploy Redis HA (#270) * feat: argo-cd can deploy Redis HA Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: add unarchived subchart redis-ha Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: Redis HA upgraded since 4.3.4 contains a bug on the chart Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * docs: how to configure Redis and Redis HA * fix: add missing chart folder Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: Helm bug with subcharts and alias * fix: Chart version * fix: Remove archived subcharts Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: lint script Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * Revert "fix: lint script" This reverts commit f4b81cbb6fc6d6c271f07b3d271a110b43edb9dd. * fix: lint and publish scripts Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: align test-image versions Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: remove sudo from scripts Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: add required repositories to helm Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: simplify expression Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: bump up chart version Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> Co-authored-by: Spencer Gilbert <Spencer.Gilbert@gmail.com>
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:
{{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.redis.deploymentAnnotations) }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
name: {{ include "argo-cd.redis.fullname" . }}
feat(argo-cd): Support ability to set .Values.namespaceOverride (#2679) * feat(argo-workflows): Allow adding additional ServiceAccounts to RoleBinding (#2676) remove unnecessary if statements Signed-off-by: Daniel Beilin <daniel.beilin@outlook.com> Co-authored-by: Aikawa <yu.croco@gmail.com> Signed-off-by: Andres Vara Parsegov <andres.vara@chase.com> * feat(argo-cd): Support ability to set .Values.namespaceOverride Signed-off-by: Andres Vara Parsegov <andres.vara@chase.com> * fix(argo-cd): typo Signed-off-by: Andres Vara Parsegov <andres.vara@chase.com> * chore(deps): update actions/create-github-app-token action to v1.10.0 (#2677) Co-authored-by: renovate[bot] <renovate[bot]@users.noreply.github.com> Signed-off-by: Andres Vara Parsegov <andres.vara@chase.com> * feat(argo-rollouts): Add podLabels at the controller & dashboard level (#2678) Signed-off-by: Andres Vara Parsegov <andres.vara@chase.com> * feat(argo-cd): Support ability to set .Values.namespaceOverride Signed-off-by: Andres Vara Parsegov <andres.vara@chase.com> * fix(argo-cd): typo Signed-off-by: Andres Vara Parsegov <andres.vara@chase.com> * fix(argo-cd): autocorrection Signed-off-by: Andres Vara Parsegov <andres.vara@chase.com> * fix(argo-cd): typos Signed-off-by: Andres Vara Parsegov <andres.vara@chase.com> * fix(argo-cd): typos Signed-off-by: Andres Vara Parsegov <andres.vara@chase.com> * removed auota Signed-off-by: Andres Vara Parsegov <andres.vara@chase.com> * Update Chart.yaml Signed-off-by: Andres Vara <46708607+andres-vara@users.noreply.github.com> --------- Signed-off-by: Daniel Beilin <daniel.beilin@outlook.com> Signed-off-by: Andres Vara Parsegov <andres.vara@chase.com> Signed-off-by: Andres Vara <46708607+andres-vara@users.noreply.github.com> Co-authored-by: Daniel Beilin <144586547+dbeilin@users.noreply.github.com> Co-authored-by: Aikawa <yu.croco@gmail.com> Co-authored-by: Andres Vara Parsegov <andres.vara@chase.com> Co-authored-by: argoproj-renovate[bot] <161757507+argoproj-renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <renovate[bot]@users.noreply.github.com> Co-authored-by: mitchell amihod <mitchell@amihod.com>
2024-05-14 15:17:31 +00:00
namespace: {{ include "argo-cd.namespace" . }}
2019-11-05 00:17:25 +00:00
labels:
{{- 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:
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:
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 }}
{{- with (mergeOverwrite (deepCopy .Values.global.podAnnotations) .Values.redis.podAnnotations) }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
2019-11-05 00:17:25 +00:00
spec:
{{- with .Values.redis.runtimeClassName | default .Values.global.runtimeClassName }}
runtimeClassName: {{ . }}
{{- end }}
{{- with .Values.redis.imagePullSecrets | default .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.redis.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.redis.priorityClassName | default .Values.global.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
{{- if .Values.redis.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.redis.terminationGracePeriodSeconds }}
{{- end }}
serviceAccountName: {{ include "argo-cd.redis.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.redis.automountServiceAccountToken }}
2019-11-05 00:17:25 +00:00
containers:
- 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:
{{- with .Values.redis.extraArgs }}
{{- toYaml . | nindent 8 }}
{{- end }}
2019-11-05 00:17:25 +00:00
- --save
- ""
- --appendonly
- "no"
- --requirepass $(REDIS_PASSWORD)
env:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: argocd-redis
key: auth
{{- with (concat .Values.global.env .Values.redis.env) }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.redis.envFrom }}
envFrom:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- 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:
- name: redis
containerPort: {{ .Values.redis.containerPorts.redis }}
protocol: TCP
2019-11-05 00:17:25 +00:00
resources:
{{- toYaml .Values.redis.resources | nindent 10 }}
{{- with .Values.redis.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
volumeMounts:
- mountPath: /health
name: health
{{- with .Values.redis.volumeMounts }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- if .Values.redis.exporter.enabled }}
- name: metrics
image: {{ .Values.redis.exporter.image.repository }}:{{ .Values.redis.exporter.image.tag }}
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.redis.exporter.image.imagePullPolicy }}
env:
- name: REDIS_ADDR
value: {{ printf "redis://localhost:%v" .Values.redis.containerPorts.redis }}
- name: REDIS_EXPORTER_WEB_LISTEN_ADDRESS
value: {{ printf "0.0.0.0:%v" .Values.redis.containerPorts.metrics }}
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: argocd-redis
key: auth
{{- with (concat .Values.global.env .Values.redis.exporter.env) }}
{{- toYaml . | nindent 8 }}
{{- end }}
ports:
- name: metrics
containerPort: {{ .Values.redis.containerPorts.metrics }}
protocol: TCP
{{- 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 }}
resources:
{{- toYaml .Values.redis.exporter.resources | nindent 10 }}
{{- with .Values.redis.exporter.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- end }}
{{- with .Values.redis.extraContainers }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- with .Values.redis.initContainers }}
initContainers:
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- with .Values.redis.nodeSelector | default .Values.global.nodeSelector }}
2019-11-05 00:17:25 +00:00
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.redis.tolerations | default .Values.global.tolerations }}
2019-11-05 00:17:25 +00:00
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with include "argo-cd.affinity" (dict "context" . "component" .Values.redis) }}
2019-11-05 00:17:25 +00:00
affinity:
{{- trim . | nindent 8 }}
{{- end }}
{{- with .Values.redis.topologySpreadConstraints | default .Values.global.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-05 00:17:25 +00:00
volumes:
- name: health
configMap:
name: {{ include "argo-cd.redis.fullname" . }}-health-configmap
defaultMode: 493
{{- with .Values.redis.volumes }}
{{- toYaml . | nindent 8}}
{{- end }}
{{- with .Values.redis.dnsConfig }}
dnsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
dnsPolicy: {{ .Values.redis.dnsPolicy }}
2019-11-05 00:17:25 +00:00
{{- end }}