argocd-helm/charts/argo-cd/templates/redis/deployment.yaml
Carlos Juan Gómez Peñalver d7da8e863f
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 12:31:13 -04:00

88 lines
3.1 KiB
YAML
Executable file

{{- $redisHa := (index .Values "redis-ha") -}}
{{- if and .Values.redis.enabled (not $redisHa.enabled) -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "argo-cd.redis.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.redis.name }}
helm.sh/chart: {{ include "argo-cd.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: argocd
app.kubernetes.io/component: {{ .Values.redis.name }}
app.kubernetes.io/version: {{ .Values.redis.image.tag }}
spec:
selector:
matchLabels:
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.redis.name }}
template:
metadata:
{{- if .Values.redis.podAnnotations }}
annotations:
{{- range $key, $value := .Values.redis.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.redis.name }}
helm.sh/chart: {{ include "argo-cd.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: argocd
app.kubernetes.io/component: {{ .Values.redis.name }}
app.kubernetes.io/version: {{ .Values.redis.image.tag }}
{{- if .Values.redis.podLabels }}
{{- toYaml .Values.redis.podLabels | nindent 8 }}
{{- end }}
spec:
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
automountServiceAccountToken: false
{{- if .Values.global.securityContext }}
securityContext: {{- toYaml .Values.global.securityContext | nindent 8 }}
{{- end }}
containers:
- name: {{ template "argo-cd.redis.fullname" . }}
args:
- --save
- ""
- --appendonly
- "no"
image: {{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}
imagePullPolicy: {{ .Values.redis.image.imagePullPolicy}}
{{- if .Values.redis.containerSecurityContext }}
securityContext: {{- toYaml .Values.redis.containerSecurityContext | nindent 10 }}
{{- end }}
{{- if .Values.redis.env }}
env:
{{- toYaml .Values.redis.env | nindent 8 }}
{{- end }}
ports:
- containerPort: {{ .Values.redis.containerPort }}
{{- if .Values.redis.volumeMounts }}
volumeMounts:
{{- toYaml .Values.redis.volumeMounts | nindent 10 }}
{{- end }}
resources:
{{- toYaml .Values.redis.resources | nindent 10 }}
{{- 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 }}
{{- if .Values.redis.volumes }}
volumes:
{{- toYaml .Values.redis.volumes | nindent 8}}
{{- end }}
{{- end }}