apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ include "nzbhydra.fullname" . }} labels: {{- include "nzbhydra.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} serviceName: {{ include "nzbhydra.fullname" . }} selector: matchLabels: {{- include "nzbhydra.selectorLabels" . | nindent 6 }} template: metadata: labels: {{- include "nzbhydra.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "nzbhydra.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: hydra containerPort: 5076 protocol: TCP livenessProbe: tcpSocket: port: 5076 readinessProbe: tcpSocket: port: 5076 startupProbe: tcpSocket: port: 5076 failureThreshold: 30 periodSeconds: 10 resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: - name: hydra-config mountPath: /config - name: hydra-tmp mountPath: /tmp volumes: - name: hydra-tmp emptyDir: {} {{- if and .Values.config.persistence.enabled .Values.config.persistence.existingClaim }} - name: hydra-config persistentVolumeClaim: {{- with .Values.config.persistence.existingClaim }} claimName: {{ tpl . $ }} {{- end }} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- if and .Values.config.persistence.enabled (not .Values.config.persistence.existingClaim) }} volumeClaimTemplates: - metadata: name: hydra-config spec: accessModes: [ "ReadWriteOnce" ] storageClassName: {{ .Values.config.persistence.storageClassName | quote }} resources: requests: storage: {{ .Values.config.persistence.storageSize }} {{- end -}}