Add persistence
This commit is contained in:
parent
550a71b599
commit
cf233cacad
4 changed files with 31 additions and 2 deletions
|
@ -76,7 +76,7 @@ spec:
|
|||
- name: localstore-volume
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.persistence.existingClaim | default (include "mediawiki.fullname" .) }}
|
||||
claimName: {{ default (include "mediawiki.fullname" .) .Values.persistence.existingClaim }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: {{ include "mediawiki.fullname" . }}
|
||||
name: {{ include "mediawiki.fullname" . }}-setup
|
||||
labels:
|
||||
{{- include "mediawiki.labels" . | nindent 4 }}
|
||||
spec:
|
||||
|
|
22
zombi/mediawiki/templates/pvc.yaml
Normal file
22
zombi/mediawiki/templates/pvc.yaml
Normal file
|
@ -0,0 +1,22 @@
|
|||
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ include "mediawiki.fullname" . }}
|
||||
labels:
|
||||
{{- include "mediawiki.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": "pre-install"
|
||||
{{- if .Values.persistence.annotations }}
|
||||
{{ toYaml .Values.persistence.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.persistence.accessMode | quote }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size | quote }}
|
||||
{{- if .Values.persistence.storageClass }}
|
||||
storageClassName: {{ .Values.persistence.storageClass | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
|
@ -17,6 +17,13 @@ wiki:
|
|||
server: "https://wiki.example.org"
|
||||
secretKey: "1166f2af9b8c1e1401f38a11d95628629bef0b75b90d09b296390041d19c3b2c"
|
||||
|
||||
persistence:
|
||||
enabled: false
|
||||
accessMode: ReadWriteOnce
|
||||
size: 5Gi
|
||||
storageClass: ""
|
||||
annotations: {}
|
||||
|
||||
database:
|
||||
type: postgres
|
||||
server: postgres.example.org
|
||||
|
|
Loading…
Reference in a new issue