Attempt overlayfs to have smaller PVCs
Signed-off-by: Martyn Ranyard <m@rtyn.berlin>
This commit is contained in:
parent
9be2e70f56
commit
fd5da0635c
|
@ -33,4 +33,12 @@
|
||||||
browseable = {{ .browseable | default "yes" }}
|
browseable = {{ .browseable | default "yes" }}
|
||||||
writable = {{ .writable | default "yes" }}
|
writable = {{ .writable | default "yes" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{ if .Values.persistence.combineShares }}{{ range .Values.persistence.sharesToCombine }}
|
||||||
|
[{{ .destName }}]
|
||||||
|
path = /combined/{{ .destName }}
|
||||||
|
comment = Magic combined share
|
||||||
|
browseable = yes
|
||||||
|
writable = yes
|
||||||
|
{{- end }}{{ end }}
|
||||||
;EOF way past actual end of file
|
;EOF way past actual end of file
|
|
@ -40,6 +40,28 @@ spec:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
|
{{- if .Values.persistence.combineShares }}
|
||||||
|
- name: overlaymagic
|
||||||
|
image: busybox
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- --
|
||||||
|
args:
|
||||||
|
{{- range .Values.persistence.sharesToCombine }}
|
||||||
|
- mkdir -p /combined/{{ .destName }};
|
||||||
|
mkdir -p /data/overlay-{{ .destName }};
|
||||||
|
mount -t overlay -o lowerdir={{ join ":" .shares }},upperdir=/data/overlay-{{ .destName }}-upper,workdir=/data/overlay/{{ .destName }}-work overlay /combined/{{ .destName }};
|
||||||
|
sleep infinity;
|
||||||
|
{{- end }}
|
||||||
|
lifecycle:
|
||||||
|
preStop:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- {{ range .Values.persistence.sharesToCombine }}umount /combined/{{ .destName }}; {{- end }}
|
||||||
|
{{- end }}
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||||
command:
|
command:
|
||||||
|
|
|
@ -38,6 +38,10 @@ persistence:
|
||||||
other:
|
other:
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
extraPVCShares: []
|
extraPVCShares: []
|
||||||
|
combineShares: false
|
||||||
|
sharesToCombine:
|
||||||
|
- destName: ""
|
||||||
|
shares: []
|
||||||
|
|
||||||
privatePersistence:
|
privatePersistence:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
Loading…
Reference in New Issue