migrating to volumeClaimTemplates for sonarr

This commit is contained in:
Jeff Billimek 2019-03-10 12:58:28 -04:00
parent 43a2f362fb
commit 3cad654742
3 changed files with 33 additions and 33 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v1
appVersion: amd64-2.0.0.5318-ls31 appVersion: amd64-2.0.0.5318-ls31
description: Sonarr is a television show downloading client description: Sonarr is a television show downloading client
name: sonarr name: sonarr
version: 1.0.0 version: 1.1.1
keywords: keywords:
- sonarr - sonarr
- usenet - usenet

View File

@ -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 -}}

View File

@ -63,13 +63,6 @@ spec:
resources: resources:
{{ toYaml .Values.resources | indent 12 }} {{ toYaml .Values.resources | indent 12 }}
volumes: 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 - name: downloads
{{- if .Values.persistence.downloads.enabled }} {{- if .Values.persistence.downloads.enabled }}
persistentVolumeClaim: persistentVolumeClaim:
@ -89,6 +82,38 @@ spec:
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ .existingClaim }} claimName: {{ .existingClaim }}
{{- end }} {{- 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 }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector:
{{ toYaml . | indent 8 }} {{ toYaml . | indent 8 }}