apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ include "nzbget.fullname" . }} labels: {{- include "nzbget.labels" . | nindent 4 }} annotations: spec: serviceName: {{ .Chart.Name }} replicas: {{ .Values.replicaCount }} selector: matchLabels: {{- include "nzbget.selectorLabels" . | nindent 6 }} template: metadata: labels: {{- include "nzbget.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "nzbget.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: nzbg containerPort: 6789 protocol: TCP livenessProbe: failureThreshold: 3 initialDelaySeconds: 3 periodSeconds: 10 successThreshold: 1 tcpSocket: port: nzbg readinessProbe: failureThreshold: 3 initialDelaySeconds: 3 periodSeconds: 10 successThreshold: 1 tcpSocket: port: nzbg resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: - name: nzbget-config mountPath: /config - name: media mountPath: /media - name: local-download mountPath: /downloads volumes: - name: media persistentVolumeClaim: claimName: {{ .Values.mediaPvc }} - name: local-download emptyDir: {} {{- if and .Values.config.persistence.enabled .Values.config.persistence.existingClaim }} - name: nzbget-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 }}