2018-11-05 02:18:39 +00:00
|
|
|
apiVersion: apps/v1
|
2019-03-10 11:50:13 +00:00
|
|
|
kind: StatefulSet
|
2018-11-05 01:42:41 +00:00
|
|
|
metadata:
|
|
|
|
name: {{ include "nzbget.fullname" . }}
|
|
|
|
labels:
|
2018-11-05 05:25:41 +00:00
|
|
|
app.kubernetes.io/name: {{ include "nzbget.name" . }}
|
|
|
|
helm.sh/chart: {{ include "nzbget.chart" . }}
|
|
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
|
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
2018-11-05 01:42:41 +00:00
|
|
|
spec:
|
2019-03-12 10:47:54 +00:00
|
|
|
podManagementPolicy: "Parallel"
|
2018-11-05 01:42:41 +00:00
|
|
|
replicas: {{ .Values.replicaCount }}
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app.kubernetes.io/name: {{ include "nzbget.name" . }}
|
|
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app.kubernetes.io/name: {{ include "nzbget.name" . }}
|
|
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- name: {{ .Chart.Name }}
|
|
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
|
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
|
|
ports:
|
|
|
|
- name: http
|
|
|
|
containerPort: 6789
|
|
|
|
protocol: TCP
|
|
|
|
livenessProbe:
|
2018-11-05 01:57:35 +00:00
|
|
|
tcpSocket:
|
2018-11-05 01:42:41 +00:00
|
|
|
port: http
|
|
|
|
readinessProbe:
|
2018-11-05 01:57:35 +00:00
|
|
|
tcpSocket:
|
2018-11-05 01:42:41 +00:00
|
|
|
port: http
|
|
|
|
env:
|
|
|
|
- name: TZ
|
|
|
|
value: "{{ .Values.timezone }}"
|
|
|
|
- name: PUID
|
|
|
|
value: "{{ .Values.puid }}"
|
|
|
|
- name: PGID
|
|
|
|
value: "{{ .Values.pgid }}"
|
|
|
|
volumeMounts:
|
|
|
|
- mountPath: /config
|
|
|
|
name: config
|
|
|
|
- mountPath: /downloads
|
|
|
|
name: downloads
|
|
|
|
{{- if .Values.persistence.downloads.subPath }}
|
|
|
|
subPath: {{ .Values.persistence.downloads.subPath }}
|
|
|
|
{{ end }}
|
|
|
|
resources:
|
|
|
|
{{ toYaml .Values.resources | indent 12 }}
|
|
|
|
volumes:
|
|
|
|
- name: downloads
|
|
|
|
{{- if .Values.persistence.downloads.enabled }}
|
|
|
|
persistentVolumeClaim:
|
|
|
|
claimName: {{ if .Values.persistence.downloads.existingClaim }}{{ .Values.persistence.downloads.existingClaim }}{{- else }}{{ template "nzbget.fullname" . }}-downloads{{- end }}
|
|
|
|
{{- else }}
|
|
|
|
emptyDir: {}
|
|
|
|
{{ end }}
|
2019-03-10 17:46:20 +00:00
|
|
|
{{- if and .Values.persistence.config.enabled .Values.persistence.config.existingClaim }}
|
|
|
|
- name: config
|
|
|
|
{{- if .Values.persistence.config.enabled }}
|
|
|
|
persistentVolumeClaim:
|
|
|
|
claimName: {{ .Values.persistence.config.existingClaim }}
|
|
|
|
{{- else }}
|
|
|
|
emptyDir: {}
|
|
|
|
{{- end }}
|
|
|
|
{{- else if not .Values.persistence.config.enabled }}
|
|
|
|
- name: config
|
|
|
|
emptyDir: {}
|
|
|
|
{{- else if and .Values.persistence.config.enabled (not .Values.persistence.config.existingClaim) }}
|
|
|
|
volumeClaimTemplates:
|
|
|
|
- metadata:
|
|
|
|
name: config
|
|
|
|
labels:
|
|
|
|
app.kubernetes.io/name: {{ include "nzbget.name" . }}
|
|
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
|
|
spec:
|
|
|
|
accessModes:
|
|
|
|
- {{ .Values.persistence.config.accessMode | quote }}
|
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
storage: {{ .Values.persistence.config.size | quote }}
|
|
|
|
{{- if .Values.persistence.config.storageClass }}
|
|
|
|
{{- if (eq "-" .Values.persistence.config.storageClass) }}
|
|
|
|
storageClassName: ""
|
|
|
|
{{- else }}
|
|
|
|
storageClassName: "{{ .Values.persistence.config.storageClass }}"
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2018-11-05 01:42:41 +00:00
|
|
|
{{- with .Values.nodeSelector }}
|
|
|
|
nodeSelector:
|
|
|
|
{{ toYaml . | indent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.affinity }}
|
|
|
|
affinity:
|
|
|
|
{{ toYaml . | indent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.tolerations }}
|
|
|
|
tolerations:
|
|
|
|
{{ toYaml . | indent 8 }}
|
|
|
|
{{- end }}
|