From 3cad6547423298a2072eb8310058f9cf3f23d3fc Mon Sep 17 00:00:00 2001 From: Jeff Billimek Date: Sun, 10 Mar 2019 12:58:28 -0400 Subject: [PATCH] migrating to volumeClaimTemplates for sonarr --- sonarr/Chart.yaml | 2 +- sonarr/templates/config-pvc.yaml | 25 -------------------- sonarr/templates/statefulset.yaml | 39 +++++++++++++++++++++++++------ 3 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 sonarr/templates/config-pvc.yaml diff --git a/sonarr/Chart.yaml b/sonarr/Chart.yaml index 92d2eb96..af79d0a0 100644 --- a/sonarr/Chart.yaml +++ b/sonarr/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: amd64-2.0.0.5318-ls31 description: Sonarr is a television show downloading client name: sonarr -version: 1.0.0 +version: 1.1.1 keywords: - sonarr - usenet diff --git a/sonarr/templates/config-pvc.yaml b/sonarr/templates/config-pvc.yaml deleted file mode 100644 index 5dcf5775..00000000 --- a/sonarr/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 "sonarr.fullname" . }}-config - labels: - app.kubernetes.io/name: {{ include "sonarr.name" . }} - helm.sh/chart: {{ include "sonarr.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/sonarr/templates/statefulset.yaml b/sonarr/templates/statefulset.yaml index dd774e61..b8a19ca9 100644 --- a/sonarr/templates/statefulset.yaml +++ b/sonarr/templates/statefulset.yaml @@ -63,13 +63,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 "sonarr.fullname" . }}-config{{- end }} - {{- else }} - emptyDir: {} - {{- end }} - name: downloads {{- if .Values.persistence.downloads.enabled }} persistentVolumeClaim: @@ -89,6 +82,38 @@ spec: persistentVolumeClaim: claimName: {{ .existingClaim }} {{- 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 "sonarr.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 }}