From 46a609e7a204439304d499d3016858ce0dd0c6ff Mon Sep 17 00:00:00 2001 From: Jeff Billimek Date: Sun, 10 Mar 2019 13:18:39 -0400 Subject: [PATCH] migrating to volumeClaimTemplates for rtorrent-flood --- rtorrent-flood/Chart.yaml | 2 +- rtorrent-flood/templates/config-pvc.yaml | 25 --------------- rtorrent-flood/templates/statefulset.yaml | 39 +++++++++++++++++++---- 3 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 rtorrent-flood/templates/config-pvc.yaml diff --git a/rtorrent-flood/Chart.yaml b/rtorrent-flood/Chart.yaml index 9f25d838..f1c4f4b5 100644 --- a/rtorrent-flood/Chart.yaml +++ b/rtorrent-flood/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: 0.9.7-0.13.7 description: flood-rtorrent name: rtorrent-flood -version: 1.0.0 +version: 1.1.0 keywords: - rtorrent - flood diff --git a/rtorrent-flood/templates/config-pvc.yaml b/rtorrent-flood/templates/config-pvc.yaml deleted file mode 100644 index 13d6ef31..00000000 --- a/rtorrent-flood/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 "rtorrent-flood.fullname" . }}-config - labels: - app.kubernetes.io/name: {{ include "rtorrent-flood.name" . }} - helm.sh/chart: {{ include "rtorrent-flood.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/rtorrent-flood/templates/statefulset.yaml b/rtorrent-flood/templates/statefulset.yaml index 85d20a7b..2a220ba6 100644 --- a/rtorrent-flood/templates/statefulset.yaml +++ b/rtorrent-flood/templates/statefulset.yaml @@ -61,13 +61,6 @@ spec: resources: {{ toYaml .Values.resources | indent 12 }} volumes: - - name: flood-db - {{- if .Values.persistence.config.enabled }} - persistentVolumeClaim: - claimName: {{ if .Values.persistence.config.existingClaim }}{{ .Values.persistence.config.existingClaim }}{{- else }}{{ template "rtorrent-flood.fullname" . }}-config{{- end }} - {{- else }} - emptyDir: {} - {{ end }} - name: data {{- if .Values.persistence.data.enabled }} persistentVolumeClaim: @@ -75,6 +68,38 @@ spec: {{- else }} emptyDir: {} {{ end }} +{{- if and .Values.persistence.config.enabled .Values.persistence.config.existingClaim }} + - name: flood-db + {{- if .Values.persistence.config.enabled }} + persistentVolumeClaim: + claimName: {{ .Values.persistence.config.existingClaim }} + {{- else }} + emptyDir: {} + {{- end }} +{{- else if not .Values.persistence.config.enabled }} + - name: flood-db + emptyDir: {} +{{- else if and .Values.persistence.config.enabled (not .Values.persistence.config.existingClaim) }} + volumeClaimTemplates: + - metadata: + name: flood-db + labels: + app.kubernetes.io/name: {{ include "rtorrent-flood.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 }}