diff --git a/charts/cryostat/templates/deployment.yaml b/charts/cryostat/templates/deployment.yaml index fa764efb..3db009fc 100644 --- a/charts/cryostat/templates/deployment.yaml +++ b/charts/cryostat/templates/deployment.yaml @@ -164,5 +164,12 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} volumes: + {{- if .Values.pvc.enabled }} + - name: {{ .Chart.Name }} + persistentVolumeClaim: + claimName: {{ .Release.Name }}-persistent-volumeclaim + {{- end }} + {{- if not .Values.pvc.enabled }} - name: {{ .Chart.Name }} emptyDir: {} + {{- end }} diff --git a/charts/cryostat/templates/persistent-volumelaim.yaml b/charts/cryostat/templates/persistent-volumelaim.yaml new file mode 100644 index 00000000..110be530 --- /dev/null +++ b/charts/cryostat/templates/persistent-volumelaim.yaml @@ -0,0 +1,10 @@ +{{- if .Values.pvc.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-persistent-volumeclaim +spec: + resources: + requests: + storage: {{ .Values.pvc.storage }} +{{- end }} diff --git a/charts/cryostat/values.yaml b/charts/cryostat/values.yaml index 38dbb0eb..78e4a648 100644 --- a/charts/cryostat/values.yaml +++ b/charts/cryostat/values.yaml @@ -188,3 +188,9 @@ tolerations: [] ## @param affinity [object] Affinity for the Cryostat Pod. See: [Affinity](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#scheduling) affinity: {} + +pvc: + ## @param pvc.enabled Specify whether to use persistentVolumeClaim or EmptyDir storage + enabled: false + ## @param pvc.storage Storage size to request for the persistentVolumeClaim + storage: 500Mi