mirror of
https://github.com/Thumbscrew/k8s-charts.git
synced 2024-11-10 08:03:50 +00:00
add support for persistence
This commit is contained in:
parent
efc91e6967
commit
e8a940abea
@ -65,6 +65,26 @@ spec:
|
||||
port: http
|
||||
resources:
|
||||
{{- 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 }}
|
||||
nodeSelector:
|
||||
{{- 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,21 +58,23 @@ postgresql:
|
||||
|
||||
recipes:
|
||||
secretKey: ""
|
||||
persistence:
|
||||
static:
|
||||
enabled: false
|
||||
existingClaim: ""
|
||||
annotations: {}
|
||||
accessMode: ReadWriteOnce
|
||||
storageClass: ""
|
||||
size: 1Gi
|
||||
media:
|
||||
enabled: false
|
||||
existingClaim: ""
|
||||
annotations: {}
|
||||
accessMode: ReadWriteOnce
|
||||
storageClass: ""
|
||||
size: 1Gi
|
||||
|
||||
persistence:
|
||||
static:
|
||||
enabled: false
|
||||
existingClaim: ""
|
||||
annotations: {}
|
||||
accessMode: ReadWriteOnce
|
||||
storageClass: ""
|
||||
size: 1Gi
|
||||
media:
|
||||
enabled: false
|
||||
existingClaim: ""
|
||||
annotations: {}
|
||||
accessMode: ReadWriteOnce
|
||||
storageClass: ""
|
||||
size: 1Gi
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
className: ""
|
||||
|
Loading…
Reference in New Issue
Block a user