Skip to content

Commit 2acbbcd

Browse files
na-gapipecd-bot
authored andcommitted
add: temporary volume option (#5716)
* add: temporary volume option Signed-off-by: na-ga <[email protected]> * remove: post start Signed-off-by: na-ga <[email protected]> * add: storage class name Signed-off-by: na-ga <[email protected]> --------- Signed-off-by: na-ga <[email protected]> Signed-off-by: pipecd-bot <[email protected]>
1 parent 88c9c11 commit 2acbbcd

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ spec:
6262
- name: piped-config
6363
mountPath: /etc/piped-config
6464
readOnly: true
65+
{{- if .Values.temporaryVolume.create }}
66+
- name: piped-temporary-volume
67+
mountPath: "/tmp"
68+
readOnly: false
69+
{{- end }}
6570
resources:
6671
{{- toYaml .Values.resources | nindent 12 }}
6772
{{- with .Values.envs }}
@@ -76,6 +81,11 @@ spec:
7681
- name: piped-config
7782
configMap:
7883
name: {{ include "piped.configMapName" . }}
84+
{{- if .Values.temporaryVolume.create }}
85+
- name: piped-temporary-volume
86+
persistentVolumeClaim:
87+
claimName: {{ include "piped.temporaryVolumeName" . }}
88+
{{- end }}
7989
{{- with .Values.securityContext }}
8090
securityContext:
8191
{{- toYaml . | nindent 8 }}

manifests/piped/templates/volume.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
storageClassName: {{ .Values.temporaryVolume.storageClassName }}
10+
accessModes:
11+
- ReadWriteOnce
12+
resources:
13+
requests:
14+
storage: {{ .Values.temporaryVolume.size }}
15+
{{- end}}

manifests/piped/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ 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 storage class name of the persistent volume claim.
90+
storageClassName: ""
91+
# The size of the persistent volume claim.
92+
size: 100Gi
93+
8494
envs: []
8595

8696
securityContext:

0 commit comments

Comments
 (0)