Skip to content

Commit

Permalink
Merge pull request #31 from cinaq/mx_nfs
Browse files Browse the repository at this point in the history
extra volumes
  • Loading branch information
vktrbrlv authored Jul 12, 2024
2 parents 5b4039f + c348871 commit e02381a
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 16 deletions.
2 changes: 1 addition & 1 deletion charts/app-mendix/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: app-mendix
version: 3.0.2
version: 3.0.3
description: Mendix Application Chart.
icon: https://cinaq.github.io/helm-charts/icons/mendix-logo.png
maintainers:
Expand Down
8 changes: 4 additions & 4 deletions charts/app-mendix/templates/pv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if .Values.nfsVolume.enabled }}
{{ if .Values.persistence.nfsVolume.enabled }}
apiVersion: v1
kind: PersistentVolume
metadata:
Expand All @@ -7,10 +7,10 @@ metadata:
{{- include "app-mendix.labels" . | nindent 4 }}
spec:
capacity:
storage: {{ .Values.nfsVolume.storage }}
storage: {{ .Values.persistence.nfsVolume.storage }}
accessModes:
- ReadWriteMany
nfs:
server: {{ .Values.nfsVolume.server }}
path: {{ .Values.nfsVolume.path }}
server: {{ .Values.persistence.nfsVolume.server }}
path: {{ .Values.persistence.nfsVolume.path }}
{{ end }}
4 changes: 2 additions & 2 deletions charts/app-mendix/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if .Values.nfsVolume.enabled }}
{{ if .Values.persistence.nfsVolume.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
Expand All @@ -10,6 +10,6 @@ spec:
- ReadWriteMany
resources:
requests:
storage: {{ .Values.nfsVolume.storage }}
storage: {{ .Values.persistence.nfsVolume.storage }}
storageClassName: ""
{{ end }}
25 changes: 21 additions & 4 deletions charts/app-mendix/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,34 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.nfsVolume.enabled }}
{{- if .Values.persistence.enabled }}
volumeMounts:
- name: {{ .Values.nfsVolume.name }}
- name: empty-dir
mountPath: /tmp
{{- with .Values.persistence.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.persistence.nfsVolume.enabled }}
- name: {{ .Values.persistence.nfsVolume.name }}
mountPath: /opt/mendix/build/data/files/
{{- if .Values.persistence.nfsVolume.subPath }}
subPath: {{ .Values.persistence.nfsVolume.subPath }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.nfsVolume.enabled }}
{{- if .Values.persistence.enabled }}
volumes:
- name: {{ .Values.nfsVolume.name }}
- name: empty-dir
emptyDir: {}
{{- with .Values.persistence.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.persistence.nfsVolume.enabled }}
- name: {{ .Values.persistence.nfsVolume.name }}
persistentVolumeClaim:
claimName: {{ template "app-mendix.fullname" . }}
{{- end }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
Expand Down
25 changes: 20 additions & 5 deletions charts/app-mendix/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,24 @@ metrics:
# example: http://loki-stack:3100/loki/api/v1/push
trendsForwarderUrl: ""

nfsVolume:
persistence:
enabled: false
name: mendix-nfs
server: nfs.example.com
path: /mnt/mendixdata
storage: 10Gi

# if enabled, a pv, pvc resources will be created and mounted to statefulset
nfsVolume:
enabled: false
name: mendix-nfs
server: nfs.example.com
path: /mnt/mendixdata
storage: 10Gi
subPath: "/app"

extraVolumes: []
# - name: extra-volume
# persistentVolumeClaim:
# claimName: precreated-pvc

extraVolumeMounts: []
# - name: extra-volume
# mountPath: /path/to/mount
# subPath: "/app"

0 comments on commit e02381a

Please sign in to comment.