mirror of
https://github.com/Thumbscrew/k8s-charts.git
synced 2025-01-19 01:55:43 +00:00
add support for persistence
This commit is contained in:
parent
efc91e6967
commit
e8a940abea
@ -65,6 +65,26 @@ spec:
|
|||||||
port: http
|
port: http
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: static
|
||||||
|
mountPath: /opt/recipes/staticfiles
|
||||||
|
- name: media
|
||||||
|
mountPath: /opt/recipes/mediafiles
|
||||||
|
volumes:
|
||||||
|
- name: static
|
||||||
|
{{- if .Values.persistence.static.enabled }}
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ if .Values.persistence.static.existingClaim }}{{ .Values.persistence.static.existingClaim }}{{- else }}{{ template "tandoor-recipes.fullname" . }}-static-pvc{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
emptyDir: {}
|
||||||
|
{{- end }}
|
||||||
|
- name: media
|
||||||
|
{{- if .Values.persistence.media.enabled }}
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ if .Values.persistence.media.existingClaim }}{{ .Values.persistence.media.existingClaim }}{{- else }}{{ template "tandoor-recipes.fullname" . }}-media-pvc{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
emptyDir: {}
|
||||||
|
{{- end }}
|
||||||
{{- with .Values.nodeSelector }}
|
{{- with .Values.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
|
32
charts/tandoor-recipes/templates/pvc-media.yaml
Normal file
32
charts/tandoor-recipes/templates/pvc-media.yaml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{{- if .Values.persistence.media.enabled -}}
|
||||||
|
{{- if not .Values.persistence.media.existingClaim -}}
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: {{ template "tandoor-recipes.fullname" . }}-media-pvc
|
||||||
|
labels:
|
||||||
|
{{- include "tandoor-recipes.labels" . | nindent 4 }}
|
||||||
|
# app.kubernetes.io/name: {{ include "tandoor-recipes.name" . }}
|
||||||
|
# helm.sh/chart: {{ include "tandoor-recipes.chart" . }}
|
||||||
|
# app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
# app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
# app.kubernetes.io/component: app
|
||||||
|
{{- if .Values.persistence.media.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{ toYaml .Values.persistence.media.annotations | indent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- {{ .Values.persistence.media.accessMode | quote }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.persistence.media.size | quote }}
|
||||||
|
{{- if .Values.persistence.media.storageClass }}
|
||||||
|
{{- if (eq "-" .Values.persistence.media.storageClass) }}
|
||||||
|
storageClassName: ""
|
||||||
|
{{- else }}
|
||||||
|
storageClassName: "{{ .Values.persistence.media.storageClass }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
32
charts/tandoor-recipes/templates/pvc-static.yaml
Normal file
32
charts/tandoor-recipes/templates/pvc-static.yaml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{{- if .Values.persistence.static.enabled -}}
|
||||||
|
{{- if not .Values.persistence.static.existingClaim -}}
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: {{ template "tandoor-recipes.fullname" . }}-static-pvc
|
||||||
|
labels:
|
||||||
|
{{- include "tandoor-recipes.labels" . | nindent 4 }}
|
||||||
|
# app.kubernetes.io/name: {{ include "tandoor-recipes.name" . }}
|
||||||
|
# helm.sh/chart: {{ include "tandoor-recipes.chart" . }}
|
||||||
|
# app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
# app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
# app.kubernetes.io/component: app
|
||||||
|
{{- if .Values.persistence.static.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{ toYaml .Values.persistence.static.annotations | indent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- {{ .Values.persistence.static.accessMode | quote }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.persistence.static.size | quote }}
|
||||||
|
{{- if .Values.persistence.static.storageClass }}
|
||||||
|
{{- if (eq "-" .Values.persistence.static.storageClass) }}
|
||||||
|
storageClassName: ""
|
||||||
|
{{- else }}
|
||||||
|
storageClassName: "{{ .Values.persistence.static.storageClass }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
@ -58,7 +58,8 @@ postgresql:
|
|||||||
|
|
||||||
recipes:
|
recipes:
|
||||||
secretKey: ""
|
secretKey: ""
|
||||||
persistence:
|
|
||||||
|
persistence:
|
||||||
static:
|
static:
|
||||||
enabled: false
|
enabled: false
|
||||||
existingClaim: ""
|
existingClaim: ""
|
||||||
@ -73,6 +74,7 @@ recipes:
|
|||||||
accessMode: ReadWriteOnce
|
accessMode: ReadWriteOnce
|
||||||
storageClass: ""
|
storageClass: ""
|
||||||
size: 1Gi
|
size: 1Gi
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
enabled: false
|
enabled: false
|
||||||
className: ""
|
className: ""
|
||||||
|
Loading…
Reference in New Issue
Block a user