diff --git a/nzbget/Chart.yaml b/nzbget/Chart.yaml index 047140b9..592d0a5c 100644 --- a/nzbget/Chart.yaml +++ b/nzbget/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: amd64-v21.0-r2296-ls5 description: NZBGet is a Usenet downloader client name: nzbget -version: 1.0.0 +version: 1.1.0 keywords: - nzbget - usenet diff --git a/nzbget/templates/config-pvc.yaml b/nzbget/templates/config-pvc.yaml deleted file mode 100644 index 279889f7..00000000 --- a/nzbget/templates/config-pvc.yaml +++ /dev/null @@ -1,25 +0,0 @@ - -{{- if and .Values.persistence.config.enabled (not .Values.persistence.config.existingClaim) }} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ template "nzbget.fullname" . }}-config - labels: - 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 }} -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 -}} \ No newline at end of file diff --git a/nzbget/templates/statefulset.yaml b/nzbget/templates/statefulset.yaml index d5d766f3..cfd42ebb 100644 --- a/nzbget/templates/statefulset.yaml +++ b/nzbget/templates/statefulset.yaml @@ -51,13 +51,6 @@ spec: resources: {{ toYaml .Values.resources | indent 12 }} volumes: - - name: config - {{- if .Values.persistence.config.enabled }} - persistentVolumeClaim: - claimName: {{ if .Values.persistence.config.existingClaim }}{{ .Values.persistence.config.existingClaim }}{{- else }}{{ template "nzbget.fullname" . }}-config{{- end }} - {{- else }} - emptyDir: {} - {{ end }} - name: downloads {{- if .Values.persistence.downloads.enabled }} persistentVolumeClaim: @@ -65,6 +58,38 @@ spec: {{- else }} emptyDir: {} {{ end }} +{{- 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 }} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }}