Skip to content

Commit 9d17aec

Browse files
committed
refactor: migrate user defined persistence volumes to extraVolumes/extraVolumeMounts
Replace persistence.volumes/volumeMounts with component-level extraVolumes/ extraVolumeMounts across all components. Update values.schema.json and templates accordingly.
1 parent 86e134c commit 9d17aec

10 files changed

+90
-170
lines changed

charts/dify/templates/api-deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ spec:
121121
mountPath: {{ .Values.api.persistence.mountPath | quote }}
122122
subPath: {{ .Values.api.persistence.persistentVolumeClaim.subPath | default "" }}
123123
{{- end }}
124-
{{- if and .Values.api.persistence.enabled .Values.api.persistence.volumeMounts }}
125-
{{- include "common.tplvalues.render" (dict "value" .Values.api.persistence.volumeMounts "context" $) | nindent 8 }}
124+
{{- if .Values.api.extraVolumeMounts }}
125+
{{- include "common.tplvalues.render" (dict "value" .Values.api.extraVolumeMounts "context" $) | nindent 8 }}
126126
{{- end }}
127127
{{- if and (.Values.nodeSelector) (not .Values.api.nodeSelector) }}
128128
nodeSelector:
@@ -154,7 +154,7 @@ spec:
154154
persistentVolumeClaim:
155155
claimName: {{ .Values.api.persistence.persistentVolumeClaim.existingClaim | default (printf "%s" (include "dify.fullname" . | trunc 58)) }}
156156
{{- end }}
157-
{{- if and .Values.api.persistence.enabled .Values.api.persistence.volumes }}
158-
{{- include "common.tplvalues.render" (dict "value" .Values.api.persistence.volumes "context" $) | nindent 6 }}
157+
{{- if .Values.api.extraVolumes }}
158+
{{- include "common.tplvalues.render" (dict "value" .Values.api.extraVolumes "context" $) | nindent 6 }}
159159
{{- end }}
160160
{{- end }}

charts/dify/templates/beat-deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ spec:
8585
name: {{ template "dify.worker.fullname" . }}
8686
resources:
8787
{{- toYaml .Values.beat.resources | nindent 12 }}
88-
{{- if and .Values.beat.persistence.enabled .Values.beat.persistence.volumeMounts }}
88+
{{- if .Values.beat.extraVolumeMounts }}
8989
volumeMounts:
90-
{{- include "common.tplvalues.render" (dict "value" .Values.beat.persistence.volumeMounts "context" $) | nindent 8 }}
90+
{{- include "common.tplvalues.render" (dict "value" .Values.beat.extraVolumeMounts "context" $) | nindent 8 }}
9191
{{- end }}
9292
{{- if and (.Values.nodeSelector) (not .Values.beat.nodeSelector) }}
9393
nodeSelector:
@@ -113,8 +113,8 @@ spec:
113113
tolerations:
114114
{{ toYaml .Values.beat.tolerations | indent 8 }}
115115
{{- end }}
116-
{{- if and .Values.beat.persistence.enabled .Values.beat.persistence.volumes }}
116+
{{- if .Values.beat.extraVolumes }}
117117
volumes:
118-
{{- include "common.tplvalues.render" (dict "value" .Values.beat.persistence.volumes "context" $) | nindent 6 }}
118+
{{- include "common.tplvalues.render" (dict "value" .Values.beat.extraVolumes "context" $) | nindent 6 }}
119119
{{- end }}
120120
{{- end }}

charts/dify/templates/plugin-daemon-deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ spec:
109109
mountPath: {{ .Values.pluginDaemon.persistence.mountPath | quote }}
110110
subPath: {{ .Values.pluginDaemon.persistence.persistentVolumeClaim.subPath | default "" }}
111111
{{- end }}
112-
{{- if and .Values.pluginDaemon.persistence.enabled .Values.pluginDaemon.persistence.volumeMounts }}
113-
{{- include "common.tplvalues.render" (dict "value" .Values.pluginDaemon.persistence.volumeMounts "context" $) | nindent 8 }}
112+
{{- if .Values.pluginDaemon.extraVolumeMounts }}
113+
{{- include "common.tplvalues.render" (dict "value" .Values.pluginDaemon.extraVolumeMounts "context" $) | nindent 8 }}
114114
{{- end }}
115115
{{- if and (.Values.nodeSelector) (not .Values.pluginDaemon.nodeSelector) }}
116116
nodeSelector:
@@ -142,7 +142,7 @@ spec:
142142
persistentVolumeClaim:
143143
claimName: {{ .Values.pluginDaemon.persistence.persistentVolumeClaim.existingClaim | default (printf "%s" (include "dify.pluginDaemon.fullname" . | trunc 58)) }}
144144
{{- end }}
145-
{{- if and .Values.pluginDaemon.persistence.enabled .Values.pluginDaemon.persistence.volumes }}
146-
{{- include "common.tplvalues.render" (dict "value" .Values.pluginDaemon.persistence.volumes "context" $) | nindent 6 }}
145+
{{- if .Values.pluginDaemon.extraVolumes }}
146+
{{- include "common.tplvalues.render" (dict "value" .Values.pluginDaemon.extraVolumes "context" $) | nindent 6 }}
147147
{{- end }}
148148
{{- end }}

charts/dify/templates/proxy-deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ spec:
103103
- name: nginx-run
104104
mountPath: /var/run/nginx
105105
{{- end }}
106-
{{- if and .Values.proxy.persistence.enabled .Values.proxy.persistence.volumeMounts }}
107-
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.persistence.volumeMounts "context" $) | nindent 8 }}
106+
{{- if .Values.proxy.extraVolumeMounts }}
107+
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.extraVolumeMounts "context" $) | nindent 8 }}
108108
{{- end }}
109109
{{- if and (.Values.nodeSelector) (not .Values.proxy.nodeSelector) }}
110110
nodeSelector:
@@ -146,7 +146,7 @@ spec:
146146
- name: nginx-run
147147
emptyDir: {}
148148
{{- end }}
149-
{{- if and .Values.proxy.persistence.enabled .Values.proxy.persistence.volumes }}
150-
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.persistence.volumes "context" $) | nindent 6 }}
149+
{{- if .Values.proxy.extraVolumes }}
150+
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.extraVolumes "context" $) | nindent 6 }}
151151
{{- end }}
152152
{{- end }}

charts/dify/templates/sandbox-deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ spec:
101101
protocol: TCP
102102
resources:
103103
{{- toYaml .Values.sandbox.resources | nindent 12 }}
104-
{{- if and .Values.sandbox.persistence.enabled .Values.sandbox.persistence.volumeMounts }}
104+
{{- if .Values.sandbox.extraVolumeMounts }}
105105
volumeMounts:
106-
{{- include "common.tplvalues.render" (dict "value" .Values.sandbox.persistence.volumeMounts "context" $) | nindent 8 }}
106+
{{- include "common.tplvalues.render" (dict "value" .Values.sandbox.extraVolumeMounts "context" $) | nindent 8 }}
107107
{{- end }}
108-
{{- if and .Values.sandbox.persistence.enabled .Values.sandbox.persistence.volumes }}
108+
{{- if .Values.sandbox.extraVolumes }}
109109
volumes:
110-
{{- include "common.tplvalues.render" (dict "value" .Values.sandbox.persistence.volumes "context" $) | nindent 6 }}
110+
{{- include "common.tplvalues.render" (dict "value" .Values.sandbox.extraVolumes "context" $) | nindent 6 }}
111111
{{- end }}
112112
{{- if and (.Values.nodeSelector) (not .Values.sandbox.nodeSelector) }}
113113
nodeSelector:

charts/dify/templates/ssrf-proxy-deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ spec:
8989
mountPath: {{ .Values.ssrfProxy.log.persistence.mountPath | quote }}
9090
subPath: {{ .Values.ssrfProxy.log.persistence.persistentVolumeClaim.subPath | default "" }}
9191
{{- end }}
92-
{{- if and .Values.ssrfProxy.persistence.enabled .Values.ssrfProxy.persistence.volumeMounts }}
93-
{{- include "common.tplvalues.render" (dict "value" .Values.ssrfProxy.persistence.volumeMounts "context" $) | nindent 8 }}
92+
{{- if .Values.ssrfProxy.extraVolumeMounts }}
93+
{{- include "common.tplvalues.render" (dict "value" .Values.ssrfProxy.extraVolumeMounts "context" $) | nindent 8 }}
9494
{{- end }}
9595
resources:
9696
{{- toYaml .Values.ssrfProxy.resources | nindent 12 }}
@@ -128,7 +128,7 @@ spec:
128128
persistentVolumeClaim:
129129
claimName: {{ .Values.ssrfProxy.log.persistence.persistentVolumeClaim.existingClaim | default (printf "%s-logs" (include "dify.ssrfProxy.fullname" . | trunc 58)) }}
130130
{{- end }}
131-
{{- if and .Values.ssrfProxy.persistence.enabled .Values.ssrfProxy.persistence.volumes }}
132-
{{- include "common.tplvalues.render" (dict "value" .Values.ssrfProxy.persistence.volumes "context" $) | nindent 6 }}
131+
{{- if .Values.ssrfProxy.extraVolumes }}
132+
{{- include "common.tplvalues.render" (dict "value" .Values.ssrfProxy.extraVolumes "context" $) | nindent 6 }}
133133
{{- end }}
134134
{{- end }}

charts/dify/templates/web-deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ spec:
105105
protocol: TCP
106106
resources:
107107
{{- toYaml .Values.web.resources | nindent 12 }}
108-
{{- if and .Values.web.persistence.enabled .Values.web.persistence.volumeMounts }}
108+
{{- if .Values.web.extraVolumeMounts }}
109109
volumeMounts:
110-
{{- include "common.tplvalues.render" (dict "value" .Values.web.persistence.volumeMounts "context" $) | nindent 8 }}
110+
{{- include "common.tplvalues.render" (dict "value" .Values.web.extraVolumeMounts "context" $) | nindent 8 }}
111111
{{- end }}
112112
{{- if and (.Values.nodeSelector) (not .Values.web.nodeSelector) }}
113113
nodeSelector:
@@ -133,8 +133,8 @@ spec:
133133
tolerations:
134134
{{ toYaml .Values.web.tolerations | indent 8 }}
135135
{{- end }}
136-
{{- if and .Values.web.persistence.enabled .Values.web.persistence.volumes }}
136+
{{- if .Values.web.extraVolumes }}
137137
volumes:
138-
{{- include "common.tplvalues.render" (dict "value" .Values.web.persistence.volumes "context" $) | nindent 6 }}
138+
{{- include "common.tplvalues.render" (dict "value" .Values.web.extraVolumes "context" $) | nindent 6 }}
139139
{{- end }}
140140
{{- end }}

charts/dify/templates/worker-deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ spec:
118118
mountPath: {{ .Values.api.persistence.mountPath | quote }}
119119
subPath: {{ .Values.api.persistence.persistentVolumeClaim.subPath | default "" }}
120120
{{- end }}
121-
{{- if and .Values.worker.persistence.enabled .Values.worker.persistence.volumeMounts }}
122-
{{- include "common.tplvalues.render" (dict "value" .Values.worker.persistence.volumeMounts "context" $) | nindent 8 }}
121+
{{- if .Values.worker.extraVolumeMounts }}
122+
{{- include "common.tplvalues.render" (dict "value" .Values.worker.extraVolumeMounts "context" $) | nindent 8 }}
123123
{{- end }}
124124
{{- if and (.Values.nodeSelector) (not .Values.worker.nodeSelector) }}
125125
nodeSelector:
@@ -151,7 +151,7 @@ spec:
151151
persistentVolumeClaim:
152152
claimName: {{ .Values.api.persistence.persistentVolumeClaim.existingClaim | default (printf "%s" (include "dify.fullname" . | trunc 58)) }}
153153
{{- end }}
154-
{{- if and .Values.worker.persistence.enabled .Values.worker.persistence.volumes }}
155-
{{- include "common.tplvalues.render" (dict "value" .Values.worker.persistence.volumes "context" $) | nindent 6 }}
154+
{{- if .Values.worker.extraVolumes }}
155+
{{- include "common.tplvalues.render" (dict "value" .Values.worker.extraVolumes "context" $) | nindent 6 }}
156156
{{- end }}
157157
{{- end }}

charts/dify/values.schema.json

Lines changed: 16 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@
205205
}
206206
}
207207
},
208+
"extraVolumes": { "type": "array" },
209+
"extraVolumeMounts": { "type": "array" },
208210
"serviceAccount": {
209211
"type": "object",
210212
"properties": {
@@ -243,18 +245,8 @@
243245
"containerSecurityContext": { "type": "object" },
244246
"extraEnv": { "type": ["array", "null"] },
245247
"logLevel": { "type": "string" },
246-
"persistence": {
247-
"type": "object",
248-
"properties": {
249-
"enabled": { "type": "boolean" },
250-
"volumes": {
251-
"type": "array"
252-
},
253-
"volumeMounts": {
254-
"type": "array"
255-
}
256-
}
257-
},
248+
"extraVolumes": { "type": "array" },
249+
"extraVolumeMounts": { "type": "array" },
258250
"serviceAccount": {
259251
"type": "object",
260252
"properties": {
@@ -288,18 +280,8 @@
288280
"containerSecurityContext": { "type": "object" },
289281
"extraEnv": { "type": ["array", "null"] },
290282
"logLevel": { "type": "string" },
291-
"persistence": {
292-
"type": "object",
293-
"properties": {
294-
"enabled": { "type": "boolean" },
295-
"volumes": {
296-
"type": "array"
297-
},
298-
"volumeMounts": {
299-
"type": "array"
300-
}
301-
}
302-
},
283+
"extraVolumes": { "type": "array" },
284+
"extraVolumeMounts": { "type": "array" },
303285
"serviceAccount": {
304286
"type": "object",
305287
"properties": {
@@ -329,18 +311,8 @@
329311
"podSecurityContext": { "type": "object" },
330312
"containerSecurityContext": { "type": "object" },
331313
"extraEnv": { "type": ["array", "null"] },
332-
"persistence": {
333-
"type": "object",
334-
"properties": {
335-
"enabled": { "type": "boolean" },
336-
"volumes": {
337-
"type": "array"
338-
},
339-
"volumeMounts": {
340-
"type": "array"
341-
}
342-
}
343-
},
314+
"extraVolumes": { "type": "array" },
315+
"extraVolumeMounts": { "type": "array" },
344316
"log": {
345317
"type": "object",
346318
"properties": {
@@ -434,18 +406,8 @@
434406
"podSecurityContext": { "type": "object" },
435407
"containerSecurityContext": { "type": "object" },
436408
"extraEnv": { "type": "array" },
437-
"persistence": {
438-
"type": "object",
439-
"properties": {
440-
"enabled": { "type": "boolean" },
441-
"volumes": {
442-
"type": "array"
443-
},
444-
"volumeMounts": {
445-
"type": "array"
446-
}
447-
}
448-
},
409+
"extraVolumes": { "type": "array" },
410+
"extraVolumeMounts": { "type": "array" },
449411
"service": {
450412
"type": "object",
451413
"properties": {
@@ -526,6 +488,8 @@
526488
"podSecurityContext": { "type": "object" },
527489
"containerSecurityContext": { "type": "object" },
528490
"extraEnv": { "type": "array" },
491+
"extraVolumes": { "type": "array" },
492+
"extraVolumeMounts": { "type": "array" },
529493
"service": {
530494
"type": "object",
531495
"properties": {
@@ -541,18 +505,6 @@
541505
"apiKey": { "type": "string" }
542506
}
543507
},
544-
"persistence": {
545-
"type": "object",
546-
"properties": {
547-
"enabled": { "type": "boolean" },
548-
"volumes": {
549-
"type": "array"
550-
},
551-
"volumeMounts": {
552-
"type": "array"
553-
}
554-
}
555-
},
556508
"serviceAccount": {
557509
"type": "object",
558510
"properties": {
@@ -581,18 +533,8 @@
581533
"podSecurityContext": { "type": "object" },
582534
"containerSecurityContext": { "type": "object" },
583535
"extraEnv": { "type": ["array", "null"] },
584-
"persistence": {
585-
"type": "object",
586-
"properties": {
587-
"enabled": { "type": "boolean" },
588-
"volumes": {
589-
"type": "array"
590-
},
591-
"volumeMounts": {
592-
"type": "array"
593-
}
594-
}
595-
},
536+
"extraVolumes": { "type": "array" },
537+
"extraVolumeMounts": { "type": "array" },
596538
"log": {
597539
"type": "object",
598540
"properties": {
@@ -653,6 +595,8 @@
653595
"podSecurityContext": { "type": "object" },
654596
"containerSecurityContext": { "type": "object" },
655597
"extraEnv": { "type": ["array", "null"] },
598+
"extraVolumes": { "type": "array" },
599+
"extraVolumeMounts": { "type": "array" },
656600
"service": {
657601
"type": "object",
658602
"properties": {

0 commit comments

Comments
 (0)