Skip to content

Commit ad099b9

Browse files
committed
feat: add podVolumes and podVolumeMounts
1 parent 97c3c97 commit ad099b9

File tree

9 files changed

+41
-0
lines changed

9 files changed

+41
-0
lines changed

toggle-django-helm/templates/_helpers.tpl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,23 @@ Generate default labels for app deployments
146146
{{ toYaml . }}
147147
{{- end }}
148148
{{- end }}
149+
150+
{{/*
151+
Generate default volumes for app deployments
152+
*/}}
153+
{{- define "django-app.appDefaultVolumes" -}}
154+
{{- if .Values.podVolumes }}
155+
volumes:
156+
{{ .Values.podVolumes | toYaml | indent 2 }}
157+
{{- end }}
158+
{{- end }}
159+
160+
{{/*
161+
Generate default volumes mounts for app deployments
162+
*/}}
163+
{{- define "django-app.appDefaultVolumeMounts" -}}
164+
{{- if .Values.podVolumeMounts }}
165+
volumeMounts:
166+
{{ .Values.podVolumeMounts | toYaml | indent 2 }}
167+
{{- end }}
168+
{{- end }}

toggle-django-helm/templates/api/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,6 @@ spec:
5050
(dict "Values" $.Values "Type" "web" )
5151
| nindent 12
5252
}}
53+
{{- with (include "django-app.appDefaultVolumeMounts" $) -}}{{ . | nindent 10 }}{{- end }}
5354

5455
{{- end }}

toggle-django-helm/templates/argo-hooks/hook-job.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ spec:
5252
(dict "Values" $.Values "Type" "hook" )
5353
| nindent 12
5454
}}
55+
{{- with (include "django-app.appDefaultVolumeMounts" $) -}}{{ . | nindent 10 }}{{- end }}
5556

5657
{{- end }}
5758

toggle-django-helm/templates/celery-flower/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ spec:
4747
(dict "Values" $.Values "Type" "worker" )
4848
| nindent 12
4949
}}
50+
{{- with (include "django-app.appDefaultVolumeMounts" $) -}}{{ . | nindent 10 }}{{- end }}
5051

5152
{{- end }}
5253
{{- end }}

toggle-django-helm/templates/cronjobs/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ spec:
6060
(dict "Values" $.Values "Type" "cronjob" )
6161
| nindent 16
6262
}}
63+
{{- with (include "django-app.appDefaultVolumeMounts" $) -}}{{ . | nindent 14 }}{{- end }}
6364

6465
{{- end }}
6566

toggle-django-helm/templates/worker-beat/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,6 @@ spec:
4646
(dict "Values" $.Values "Type" "worker" )
4747
| nindent 12
4848
}}
49+
{{- with (include "django-app.appDefaultVolumeMounts" $) -}}{{ . | nindent 10 }}{{- end }}
4950

5051
{{- end }}

toggle-django-helm/templates/worker/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ spec:
5656
(dict "Values" $.Values "Type" "worker" )
5757
| nindent 12
5858
}}
59+
{{- with (include "django-app.appDefaultVolumeMounts" $) -}}{{ . | nindent 10 }}{{- end }}
5960

6061
{{- end }}
6162

toggle-django-helm/tests/values-2.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ podAnnotations:
77
aws.workload.identity/use2: "true"
88
aws.workload.identity/use3: "true"
99

10+
podVolumes:
11+
- name: my-stuff
12+
csi:
13+
driver: "secrets-store.csi.k8s.io"
14+
readOnly: "true"
15+
volumeAttributes:
16+
secretProviderClass: my-secret-provider
17+
18+
podVolumeMounts:
19+
- name: my-secret
20+
mountPath: /mnt/secrets-store
21+
readOnly: true
22+
1023
image:
1124
name: ghcr.io/example/example
1225
tag: v1.0.1

toggle-django-helm/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ appTypeEnvName: "DJANGO_APP_TYPE"
44

55
podLabels: {}
66
podAnnotations: {}
7+
podVolumes: []
8+
podVolumeMounts: []
79

810
image: {}
911
# name:

0 commit comments

Comments
 (0)