Skip to content

Commit 3bc3fb8

Browse files
committed
add: temporary volume option
1 parent 2b4423c commit 3bc3fb8

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

manifests/piped/templates/_helpers.tpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ Name of Secret containing sensitive data
7373
{{- end }}
7474
{{- end }}
7575

76+
{{/*
77+
Name of Temporary Volume containing piped configuration
78+
*/}}
79+
{{- define "piped.temporaryVolumeName" -}}
80+
{{- if .Values.temporaryVolume.create }}
81+
{{- include "piped.fullname" . }}
82+
{{- else }}
83+
{{- .Values.temporaryVolume.name }}
84+
{{- end }}
85+
{{- end }}
86+
7687
{{/*
7788
Name of ServiceAccount
7889
*/}}

manifests/piped/templates/deployment.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ spec:
4040
args:
4141
{{- include "piped.pipedArgs" . | nindent 12 }}
4242
{{- end }}
43+
{{- if .Values.temporaryVolume.create }}
44+
lifecycle:
45+
postStart:
46+
exec:
47+
command: ["/bin/rm", "-rf", "/tmp/*"]
48+
{{- end }}
4349
ports:
4450
- name: admin
4551
containerPort: 9085
@@ -62,6 +68,11 @@ spec:
6268
- name: piped-config
6369
mountPath: /etc/piped-config
6470
readOnly: true
71+
{{- if .Values.temporaryVolume.create }}
72+
- name: piped-temporary-volume
73+
mountPath: "/tmp"
74+
readOnly: false
75+
{{- end }}
6576
resources:
6677
{{- toYaml .Values.resources | nindent 12 }}
6778
{{- with .Values.envs }}
@@ -76,6 +87,11 @@ spec:
7687
- name: piped-config
7788
configMap:
7889
name: {{ include "piped.configMapName" . }}
90+
{{- if .Values.temporaryVolume.create }}
91+
- name: piped-temporary-volume
92+
persistentVolumeClaim:
93+
claimName: {{ include "piped.temporaryVolumeName" . }}
94+
{{- end }}
7995
{{- with .Values.securityContext }}
8096
securityContext:
8197
{{- toYaml . | nindent 8 }}

manifests/piped/templates/volume.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{- if .Values.temporaryVolume.create -}}
2+
apiVersion: v1
3+
kind: PersistentVolumeClaim
4+
metadata:
5+
name: {{ include "piped.temporaryVolumeName" . }}
6+
labels:
7+
{{- include "piped.labels" . | nindent 4 }}
8+
spec:
9+
accessModes:
10+
- ReadWriteOnce
11+
resources:
12+
requests:
13+
storage: {{ .Values.temporaryVolume.size }}
14+
{{- end}}

manifests/piped/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ secret:
8181
# Each item of this list has 2 fields "fileName" and "data".
8282
kubeConfigs: []
8383

84+
temporaryVolume:
85+
# Specifies whether a PersistentVolumeClaim for storing temporary data should be created.
86+
create: false
87+
# The name of the PersistentVolumeClaim to use when create is false.
88+
name: ""
89+
# The size of the persistent volume claim.
90+
size: 100Gi
91+
8492
envs: []
8593

8694
securityContext:

0 commit comments

Comments
 (0)