From 59c9237be56101332df6f29915efe1060dddd2d6 Mon Sep 17 00:00:00 2001 From: Ben Ashby Date: Fri, 26 Mar 2021 09:59:02 -0600 Subject: [PATCH] integrated pvc's --- chart/templates/appdata-pvc.yaml | 12 +++---- chart/templates/deployment.yaml | 62 ++++++++++++++++++++++++++++++++ chart/values.yaml | 7 +++- 3 files changed, 74 insertions(+), 7 deletions(-) diff --git a/chart/templates/appdata-pvc.yaml b/chart/templates/appdata-pvc.yaml index 0cd5e0e..e426650 100644 --- a/chart/templates/appdata-pvc.yaml +++ b/chart/templates/appdata-pvc.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.persistence.appData.enabled (not .Values.persistence.appData.existingClaim) }} +{{- if and .Values.persistence.appdata.enabled (not .Values.persistence.appdata.existingClaim) }} kind: PersistentVolumeClaim apiVersion: v1 metadata: @@ -7,15 +7,15 @@ metadata: {{- include "youtubedl-material.labels" . | nindent 4 }} spec: accessModes: - - {{ .Values.persistence.appData.accessMode | quote }} + - {{ .Values.persistence.appdata.accessMode | quote }} resources: requests: - storage: {{ .Values.persistence.appData.size | quote }} - {{- if .Values.persistence.appData.storageClass }} - {{- if (eq "-" .Values.persistence.appData.storageClass) }} + storage: {{ .Values.persistence.appdata.size | quote }} + {{- if .Values.persistence.appdata.storageClass }} + {{- if (eq "-" .Values.persistence.appdata.storageClass) }} storageClassName: "" {{- else }} - storageClassName: "{{ .Values.persistence.appData.storageClass }}" + storageClassName: "{{ .Values.persistence.appdata.storageClass }}" {{- end }} {{- end }} {{- end -}} diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 02f2fae..4d37b75 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -45,6 +45,68 @@ spec: port: http resources: {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - mountPath: /app/appdata + name: appdata + {{- if .Values.persistence.appdata.subPath }} + subPath: {{ .Values.persistence.appdata.subPath }} + {{- end }} + - mountPath: /app/audio + name: audio + {{- if .Values.persistence.audio.subPath }} + subPath: {{ .Values.persistence.audio.subPath }} + {{- end }} + - mountPath: /app/video + name: video + {{- if .Values.persistence.video.subPath }} + subPath: {{ .Values.persistence.video.subPath }} + {{- end }} + - mountPath: /app/subscriptions + name: subscriptions + {{- if .Values.persistence.subscriptions.subPath }} + subPath: {{ .Values.persistence.subscriptions.subPath }} + {{- end }} + - mountPath: /app/users + name: users + {{- if .Values.persistence.users.subPath }} + subPath: {{ .Values.persistence.users.subPath }} + {{- end }} + volumes: + - name: appdata + {{- if .Values.persistence.appdata.enabled}} + persistentVolumeClaim: + claimName: {{ if .Values.persistence.appdata.existingClaim }}{{ .Values.persistence.appdata.existingClaim }}{{- else }}{{ template "youtubedl-material.fullname" . }}-appdata{{- end }} + {{- else }} + emptyDir: {} + {{- end }} + - name: audio + {{- if .Values.persistence.audio.enabled}} + persistentVolumeClaim: + claimName: {{ if .Values.persistence.audio.existingClaim }}{{ .Values.persistence.audio.existingClaim }}{{- else }}{{ template "youtubedl-material.fullname" . }}-audio{{- end }} + {{- else }} + emptyDir: {} + {{- end }} + - name: subscriptions + {{- if .Values.persistence.subscriptions.enabled}} + persistentVolumeClaim: + claimName: {{ if .Values.persistence.subscriptions.existingClaim }}{{ .Values.persistence.subscriptions.existingClaim }}{{- else }}{{ template "youtubedl-material.fullname" . }}-subscriptions{{- end }} + {{- else }} + emptyDir: {} + {{- end }} + - name: users + {{- if .Values.persistence.users.enabled}} + persistentVolumeClaim: + claimName: {{ if .Values.persistence.users.existingClaim }}{{ .Values.persistence.users.existingClaim }}{{- else }}{{ template "youtubedl-material.fullname" . }}-users{{- end }} + {{- else }} + emptyDir: {} + {{- end }} + - name: video + {{- if .Values.persistence.video.enabled}} + persistentVolumeClaim: + claimName: {{ if .Values.persistence.video.existingClaim }}{{ .Values.persistence.video.existingClaim }}{{- else }}{{ template "youtubedl-material.fullname" . }}-video{{- end }} + {{- else }} + emptyDir: {} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/chart/values.yaml b/chart/values.yaml index fcb8b99..b192e16 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -66,7 +66,7 @@ resources: {} # memory: 128Mi persistence: - appData: + appdata: enabled: true ## If defined, storageClassName: ## If set to "-", storageClassName: "", which disables dynamic provisioning @@ -78,6 +78,7 @@ persistence: ## If you want to reuse an existing claim, you can pass the name of the PVC using ## the existingClaim variable # existingClaim: your-claim + # subPath: some-subpath accessMode: ReadWriteOnce size: 1Gi audio: @@ -93,6 +94,7 @@ persistence: ## If you want to reuse an existing claim, you can pass the name of the PVC using ## the existingClaim variable # existingClaim: your-claim + # subPath: some-subpath accessMode: ReadWriteOnce size: 50Gi video: @@ -108,6 +110,7 @@ persistence: ## If you want to reuse an existing claim, you can pass the name of the PVC using ## the existingClaim variable # existingClaim: your-claim + # subPath: some-subpath accessMode: ReadWriteOnce size: 50Gi subscriptions: @@ -123,6 +126,7 @@ persistence: ## If you want to reuse an existing claim, you can pass the name of the PVC using ## the existingClaim variable # existingClaim: your-claim + # subPath: some-subpath accessMode: ReadWriteOnce size: 50Gi users: @@ -138,6 +142,7 @@ persistence: ## If you want to reuse an existing claim, you can pass the name of the PVC using ## the existingClaim variable # existingClaim: your-claim + # subPath: some-subpath accessMode: ReadWriteOnce size: 50Gi