apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ include "redis.name" . }} namespace: {{ .Release.Namespace }} labels: {{- include "redis.labels" . | nindent 4 }} spec: replicas: {{ .Values.redis.replicas }} serviceName: {{ include "redis.name" . }} selector: matchLabels: {{- include "redis.selectorLabels" . | nindent 6 }} template: metadata: labels: {{- include "redis.selectorLabels" . | nindent 8 }} spec: terminationGracePeriodSeconds: 10 {{- with .Values.global.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.global.hub }}/higress/{{ .Values.redis.image | default "redis-stack-server" }}:{{ .Values.redis.tag | default .Chart.AppVersion }}" {{- if .Values.global.imagePullPolicy }} imagePullPolicy: {{ .Values.global.imagePullPolicy }} {{- end }} ports: - name: http containerPort: 6379 protocol: TCP livenessProbe: tcpSocket: port: 6379 initialDelaySeconds: 15 periodSeconds: 10 readinessProbe: tcpSocket: port: 6379 initialDelaySeconds: 15 periodSeconds: 10 resources: {{- toYaml .Values.redis.resources | nindent 12 }} volumeMounts: - name: config mountPath: /redis-stack.conf subPath: redis-stack.conf {{- if .Values.redis.persistence.enabled }} - name: db mountPath: /data {{- end }} {{- 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 }} volumes: - name: config configMap: name: {{ include "redis.name" . }} {{- if .Values.redis.persistence.enabled }} - name: db persistentVolumeClaim: claimName: {{ include "redis.name" . }} {{- end }}