Skip to content

Commit

Permalink
Merge pull request #5 from valtimo-platform/feature/backendpvc
Browse files Browse the repository at this point in the history
Feature/backendpvc
  • Loading branch information
RemcoRitense authored Oct 23, 2023
2 parents f2bbaf1 + f3279ef commit eb82d65
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/valtimo-backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appVersion: 0.1.0
description: A Helm chart for Kubernetes
name: valtimo-backend
type: application
version: 0.1.5
version: 0.1.6

dependencies:
- name: postgresql
Expand Down
11 changes: 11 additions & 0 deletions charts/valtimo-backend/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ spec:
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: media
mountPath: {{ .Values.persistence.mountPath }}
volumes:
- name: media
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{ -else }}{{ include "valtimo-backend.fullname" . }}{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
29 changes: 29 additions & 0 deletions charts/valtimo-backend/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "valtimo-backend.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- with .Values.persistence.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
labels:
app: {{ template "valtimo-backend.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- if .Values.persistence.storageClass }}
{{- if (eq "-" .Values.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.storageClass }}"
{{- end }}
{{- end }}
{{- end }}
20 changes: 20 additions & 0 deletions charts/valtimo-backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,26 @@ affinity: {}
# -- Refer to an existing secret to avoid managing secrets through Helm.
existingSecret: null


persistence:
# -- Enable/disable persistent volumes for Valimo-backend
enabled: false
annotations: {}
# -- persistence.size Size of data volume
size: 1Gi
# -- persistence.storageClass Storage class of backing PVC
# -- If defined, storageClassName: <storageClass>
# -- If set to "-", storageClassName: "", which disables dynamic provisioning
# -- If undefined (the default) or set to null, no storageClassName spec is
# -- set, choosing the default provisioner. (gp2 on AWS, standard on
# -- GKE, AWS & OpenStack)
# --
storageClass: ""
# -- persistence.existingClaim The name of an existing PVC to use for persistence
existingClaim: null
# -- persistence.mountPath Path to mount the volume at.
mountPath: /tmp

settings:

spring:
Expand Down

0 comments on commit eb82d65

Please sign in to comment.