{{- if .Values.redis.enabled }} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "the-other-dude.fullname" . }}-redis labels: {{- include "the-other-dude.redisLabels" . | nindent 4 }} spec: replicas: 1 selector: matchLabels: {{- include "the-other-dude.redisSelectorLabels" . | nindent 6 }} template: metadata: labels: {{- include "the-other-dude.redisSelectorLabels" . | nindent 8 }} spec: containers: - name: redis image: "{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}" imagePullPolicy: {{ .Values.redis.image.pullPolicy }} ports: - name: redis containerPort: 6379 protocol: TCP resources: {{- toYaml .Values.redis.resources | nindent 12 }} livenessProbe: exec: command: - redis-cli - ping initialDelaySeconds: 10 periodSeconds: 10 failureThreshold: 3 readinessProbe: exec: command: - redis-cli - ping initialDelaySeconds: 5 periodSeconds: 5 failureThreshold: 3 --- apiVersion: v1 kind: Service metadata: name: {{ include "the-other-dude.fullname" . }}-redis labels: {{- include "the-other-dude.redisLabels" . | nindent 4 }} spec: type: ClusterIP ports: - port: {{ .Values.redis.service.port }} targetPort: redis protocol: TCP name: redis selector: {{- include "the-other-dude.redisSelectorLabels" . | nindent 4 }} {{- end }}