{{- if .Values.redis.create }} --- apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ include "deepfence-console.fullname" . }}-redis labels: {{- include "deepfence-console.labels" . | nindent 4 }} name: {{ include "deepfence-console.fullname" . }}-redis spec: serviceName: {{ include "deepfence-console.fullname" . }}-redis replicas: 1 selector: matchLabels: {{- include "deepfence-console.selectorLabels" . | nindent 6 }} name: {{ include "deepfence-console.fullname" . }}-redis template: metadata: {{- with .Values.redis.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "deepfence-console.selectorLabels" . | nindent 8 }} name: {{ include "deepfence-console.fullname" . }}-redis spec: serviceAccountName: {{ include "deepfence-console.serviceAccountName" . }} securityContext: {{- toYaml .Values.redis.podSecurityContext | nindent 8 }} containers: - name: redis securityContext: {{- toYaml .Values.redis.securityContext | nindent 12 }} image: "{{ .Values.global.imageRepoPrefix }}/{{ .Values.redis.image.repository }}:{{ default .Values.global.imageTag .Values.redis.image.tag }}" imagePullPolicy: {{ .Values.redis.image.pullPolicy }} ports: - name: tcp containerPort: 6379 protocol: TCP livenessProbe: exec: command: - /bin/sh - -c - exec redis-cli ping initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 5 successThreshold: 1 readinessProbe: exec: command: - /bin/sh - -c - exec redis-cli ping initialDelaySeconds: 60 periodSeconds: 30 timeoutSeconds: 5 failureThreshold: 5 successThreshold: 1 resources: {{- toYaml .Values.redis.resources | nindent 12 }} volumeMounts: - mountPath: /data name: "redis" {{- with .Values.redis.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.redis.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.redis.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} volumeClaimTemplates: - metadata: name: "redis" spec: accessModes: - "ReadWriteOnce" resources: requests: storage: "{{ .Values.redis.volumeSize }}" storageClassName: {{ default .Values.global.storageClass .Values.redis.storageClass }} --- apiVersion: v1 kind: Service metadata: name: {{ include "deepfence-console.fullname" . }}-redis labels: {{- include "deepfence-console.labels" . | nindent 4 }} name: {{ include "deepfence-console.fullname" . }}-redis spec: type: ClusterIP ports: - port: 6379 targetPort: tcp protocol: TCP name: tcp selector: {{- include "deepfence-console.selectorLabels" . | nindent 4 }} name: {{ include "deepfence-console.fullname" . }}-redis {{- end }}