github.com/argoproj/argo-cd@v1.8.7/util/helm/testdata/redis/templates/redis-slave-deployment.yaml (about) 1 {{- if .Values.cluster.enabled }} 2 apiVersion: extensions/v1beta1 3 kind: Deployment 4 metadata: 5 name: {{ template "redis.fullname" . }}-slave 6 labels: 7 app: {{ template "redis.name" . }} 8 chart: {{ template "redis.chart" . }} 9 release: "{{ .Release.Name }}" 10 heritage: "{{ .Release.Service }}" 11 spec: 12 {{- if .Values.cluster.slaveCount }} 13 replicas: {{ .Values.cluster.slaveCount }} 14 {{- end }} 15 template: 16 metadata: 17 labels: 18 release: "{{ .Release.Name }}" 19 role: slave 20 app: {{ template "redis.name" . }} 21 {{- if (.Values.slave.podLabels | default .Values.master.podLabels) }} 22 {{ toYaml (.Values.slave.podLabels | default .Values.master.podLabels) | indent 8 }} 23 {{- end }} 24 {{- if (.Values.slave.podAnnotations | default .Values.master.podAnnotations) }} 25 annotations: 26 {{ toYaml (.Values.slave.podAnnotations | default .Values.master.podAnnotations) | indent 8 }} 27 {{- end }} 28 spec: 29 {{- if .Values.image.pullSecrets }} 30 imagePullSecrets: 31 {{- range .Values.image.pullSecrets }} 32 - name: {{ . }} 33 {{- end}} 34 {{- end}} 35 {{- /* Include master securityContext if slave securityContext not defined */ -}} 36 {{ include "redis.slave.securityContext" . | indent 6 }} 37 serviceAccountName: "{{ template "redis.serviceAccountName" . }}" 38 {{- if (.Values.slave.nodeSelector | default .Values.master.nodeSelector) }} 39 nodeSelector: 40 {{ toYaml (.Values.slave.nodeSelector | default .Values.master.nodeSelector) | indent 8 }} 41 {{- end }} 42 {{- if (.Values.slave.tolerations | default .Values.master.tolerations) }} 43 tolerations: 44 {{ toYaml (.Values.slave.tolerations | default .Values.master.tolerations) | indent 8 }} 45 {{- end }} 46 {{- if .Values.slave.schedulerName }} 47 schedulerName: "{{ .Values.slave.schedulerName }}" 48 {{- end }} 49 {{- with .Values.slave.affinity }} 50 affinity: 51 {{ toYaml . | indent 8 }} 52 {{- end }} 53 containers: 54 - name: {{ template "redis.fullname" . }} 55 image: {{ template "redis.image" . }} 56 imagePullPolicy: {{ .Values.image.pullPolicy | default "" | quote }} 57 {{- if (.Values.slave.args | default .Values.master.args) }} 58 args: 59 {{ toYaml (.Values.slave.args | default .Values.master.args) | indent 10 }} 60 {{- end }} 61 env: 62 - name: REDIS_REPLICATION_MODE 63 value: slave 64 - name: REDIS_MASTER_HOST 65 value: {{ template "redis.fullname" . }}-master 66 - name: REDIS_PORT 67 value: {{ .Values.slave.port | default .Values.master.port | quote }} 68 - name: REDIS_MASTER_PORT_NUMBER 69 value: {{ .Values.master.port | quote }} 70 {{- if .Values.usePassword }} 71 - name: REDIS_PASSWORD 72 valueFrom: 73 secretKeyRef: 74 {{- if .Values.existingSecret }} 75 name: {{ .Values.existingSecret }} 76 {{- else }} 77 name: {{ template "redis.fullname" . }} 78 {{- end }} 79 key: redis-password 80 - name: REDIS_MASTER_PASSWORD 81 valueFrom: 82 secretKeyRef: 83 {{- if .Values.existingSecret }} 84 name: {{ .Values.existingSecret }} 85 {{- else }} 86 name: {{ template "redis.fullname" . }} 87 {{- end }} 88 key: redis-password 89 {{- else }} 90 - name: ALLOW_EMPTY_PASSWORD 91 value: "yes" 92 {{- end }} 93 - name: REDIS_DISABLE_COMMANDS 94 value: {{ .Values.slave.disableCommands | default .Values.master.disableCommands }} 95 {{- if (.Values.slave.extraFlags | default .Values.master.extraFlags) }} 96 - name: REDIS_EXTRA_FLAGS 97 value: {{ .Values.slave.extraFlags | default .Values.master.extraFlags | join " " }} 98 {{- end }} 99 ports: 100 - name: redis 101 containerPort: {{ .Values.slave.port | default .Values.master.port }} 102 {{- /* Include master livenessProbe if slave livenessProbe not defined */ -}} 103 {{ include "redis.slave.livenessProbe" . | indent 8 }} 104 {{- /* Include master readinessProbe if slave readinessProbe not defined */ -}} 105 {{ include "redis.slave.readinessProbe" . | indent 8 }} 106 resources: 107 {{ toYaml (.Values.slave.resources | default .Values.master.resources) | indent 10 }} 108 {{- end }}