Skip to content

Commit

Permalink
Custom volume config
Browse files Browse the repository at this point in the history
Add an option for custom volume configuration.
  • Loading branch information
antejavor authored Aug 8, 2024
1 parent a840d47 commit 845a824
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
32 changes: 32 additions & 0 deletions charts/memgraph/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ spec:
- name: {{ include "memgraph.fullname" . }}-log-storage
mountPath: /var/log/memgraph
{{- end }}
{{- if .Values.persistentVolumeClaim.createUserClaim }}
- name: {{ include "memgraph.fullname" . }}-user-storage
mountPath: {{ .Values.persistentVolumeClaim.userMountPath }}
{{- end }}

command: ["/bin/sh", "-c"]
args:
- >
Expand All @@ -48,6 +53,9 @@ spec:
{{- if .Values.persistentVolumeClaim.createLogStorage }}
chown -R memgraph:memgraph /var/log/memgraph;
{{- end }}
{{- if .Values.persistentVolumeClaim.createUserClaim }}
chown -R memgraph:memgraph {{ .Values.persistentVolumeClaim.userMountPath }};
{{- end }}
securityContext:
privileged: true
readOnlyRootFilesystem: false
Expand Down Expand Up @@ -78,6 +86,12 @@ spec:
claimName: {{ include "memgraph.fullname" . }}-log-storage
{{- end }}

{{- if .Values.persistentVolumeClaim.createUserClaim }}
- name: {{ include "memgraph.fullname" . }}-user-storage
persistentVolumeClaim:
claimName: {{ include "memgraph.fullname" . }}-user-storage
{{- end }}

containers:
- name: memgraph
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
Expand Down Expand Up @@ -168,6 +182,10 @@ spec:
- name: {{ include "memgraph.fullname" . }}-lib-storage
mountPath: /var/log/memgraph
{{- end }}
{{- if .Values.persistentVolumeClaim.createUserClaim }}
- name: {{ include "memgraph.fullname" . }}-user-storage
mountPath: {{ .Values.persistentVolumeClaim.userMountPath }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down Expand Up @@ -218,3 +236,17 @@ spec:
requests:
storage: {{ .Values.persistentVolumeClaim.logStorageSize }}
{{- end }}

{{- if .Values.persistentVolumeClaim.createUserClaim }}
- metadata:
name: {{ include "memgraph.fullname" . }}-user-storage
spec:
accessModes:
- "ReadWriteOnce"
{{- if .Values.persistentVolumeClaim.userStorageClassName }}
storageClassName: {{ .Values.persistentVolumeClaim.userStorageClassName }}
{{- end }}
resources:
requests:
storage: {{ .Values.persistentVolumeClaim.userStorageSize }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/memgraph/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ persistentVolumeClaim:
logStorageClassName: ""
logStorageSize: 1Gi

## Create a Dynamic Persistant Volume Claim for Configs, Certificates (e.g. Bolt cert ) and rest of User related files
createUserClaim: false
userStorageClassName: ""
userStorageSize: 1Gi
userMountPath: ""

memgraphConfig:
- "--also-log-to-stderr=true"

Expand Down

0 comments on commit 845a824

Please sign in to comment.