Skip to content

Commit 2f60a5e

Browse files
committed
use statefulset pvc template creation
1 parent b91012a commit 2f60a5e

File tree

3 files changed

+30
-35
lines changed

3 files changed

+30
-35
lines changed

charts/part-db/templates/config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ stringData:
3030
DB_PASSWORD: {{ .password | quote }}
3131
DB_HOSTNAME: {{ .host | quote }}
3232
DB_DATABASE: {{ .db | quote }}
33-
{{- end }}
3433
{{- end }}
3534
{{- end }}
3635

charts/part-db/templates/pvc.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

charts/part-db/templates/statefulset.yaml

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ spec:
5050
{{- toYaml .Values.extraVars | nindent 10 }}
5151
{{- end }}
5252
volumeMounts:
53-
- name: pub
53+
- name: data
5454
mountPath: /var/www/html/var/db
5555
subPath: db
5656
containers:
@@ -75,21 +75,41 @@ spec:
7575
port: http
7676
timeoutSeconds: 5
7777
volumeMounts:
78-
- name: pub
78+
- name: data
7979
mountPath: /var/www/html/var/db
8080
subPath: db
81-
- name: pub
81+
- name: data
8282
mountPath: /var/www/html/uploads
8383
subPath: uploads
84-
- name: pub
84+
- name: data
8585
mountPath: /var/www/html/public/media
8686
subPath: public_media
8787
volumes:
88-
{{- if .Values.persistence.enabled }}
89-
- name: pub
88+
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
89+
- name: data
9090
persistentVolumeClaim:
91-
claimName: {{ .Values.persistence.existingClaim | default ( include "app.fullname" . ) }}
92-
{{- else }}
93-
- name: pub
91+
claimName: {{ .Values.persistence.existingClaim }}
92+
{{- else if not .Values.persistence.enabled }}
93+
- name: data
9494
emptyDir: {}
95-
{{- end }}
95+
{{- else }}
96+
[]
97+
volumeClaimTemplates:
98+
- metadata:
99+
name: data
100+
spec:
101+
{{- with .Values.persistence }}
102+
{{- if .storageClass }}
103+
{{- if (eq "-" .storageClass) }}
104+
storageClassName: ""
105+
{{- else }}
106+
storageClassName: "{{ .storageClass }}"
107+
{{- end }}
108+
{{- end }}
109+
accessModes:
110+
- {{ .accessMode | quote }}
111+
resources:
112+
requests:
113+
storage: {{ .size | quote }}
114+
{{- end }}
115+
{{- end }}

0 commit comments

Comments
 (0)