Skip to content

Commit

Permalink
Merge pull request #99 from maykinmedia/feature/opennotificaties-pvc
Browse files Browse the repository at this point in the history
Persist /app/media
  • Loading branch information
sjoerdie authored Mar 22, 2024
2 parents f246da5 + 4f1440d commit 25ad79c
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/opennotificaties/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: opennotificaties
description: API voor het routeren van notificaties

type: application
version: 1.2.3
version: 1.2.4
appVersion: 1.5.2

dependencies:
Expand Down
9 changes: 9 additions & 0 deletions charts/opennotificaties/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ data:
{{- if .Values.settings.cleanOldNotifications.daysRetained }}
NOTIFICATION_NUMBER_OF_DAYS_RETAINED: {{ .Values.settings.cleanOldNotifications.daysRetained | toString | quote }}
{{- end }}
{{- if .Values.settings.maxRetries }}
NOTIFICATION_DELIVERY_MAX_RETRIES: {{ .Values.settings.maxRetries | toString | quote }}
{{- end }}
{{- if .Values.settings.retryBackoff }}
NOTIFICATION_DELIVERY_RETRY_BACKOFF: {{ .Values.settings.retryBackoff | toString | quote }}
{{- end }}
{{- if .Values.settings.retryBackoffMax }}
NOTIFICATION_DELIVERY_RETRY_BACKOFF_MAX: {{ .Values.settings.retryBackoffMax | toString | quote }}
{{- end }}
DB_NAME: {{ .Values.settings.database.name | toString | quote }}
DB_HOST: {{ .Values.settings.database.host | toString | quote }}
DB_USER: {{ .Values.settings.database.username | toString | quote }}
Expand Down
34 changes: 25 additions & 9 deletions charts/opennotificaties/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,20 @@ spec:
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: media
mountPath: /app/media
subPath: {{ .Values.persistence.mediaMountSubpath | default "opennotificaties/media" }}
{{- if .Values.extraVolumeMounts }}
{{- include "opennotificaties.tplvalues.render" ( dict "value" .Values.extraVolumeMounts "context" $ ) | nindent 12 }}
{{- end }}
volumes:
- name: media
persistentVolumeClaim:
{{- if .Values.persistence.enabled }}
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ include "opennotificaties.fullname" . }}{{- end }}
{{- else }}
emptyDir: { }
{{- end }}
{{- if .Values.extraVolumes }}
{{- include "opennotificaties.tplvalues.render" ( dict "value" .Values.extraVolumes "context" $ ) | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -145,15 +155,18 @@ spec:
{{- toYaml .Values.worker.resources | nindent 12 }}
command:
- /celery_worker.sh
volumeMounts:
{{- if .Values.extraVolumeMounts }}
{{- include "opennotificaties.tplvalues.render" ( dict "value" .Values.extraVolumeMounts "context" $ ) | nindent 12 }}
{{- end }}
volumes:
- name: media
persistentVolumeClaim:
{{- if .Values.persistence.enabled }}
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ include "opennotificaties.fullname" . }}{{- end }}
{{- else }}
emptyDir: { }
{{- end }}
{{- if .Values.extraVolumes }}
{{- include "opennotificaties.tplvalues.render" ( dict "value" .Values.extraVolumes "context" $ ) | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -230,11 +243,14 @@ spec:
tcpSocket:
port: 5555
{{- toYaml .Values.flower.readinessProbe | nindent 12 }}
volumeMounts:
{{- if .Values.extraVolumeMounts }}
{{- include "opennotificaties.tplvalues.render" ( dict "value" .Values.extraVolumeMounts "context" $ ) | nindent 12 }}
{{- end }}
volumes:
- name: media
persistentVolumeClaim:
{{- if .Values.persistence.enabled }}
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ include "opennotificaties.fullname" . }}{{- end }}
{{- else }}
emptyDir: { }
{{- end }}
{{- if .Values.extraVolumes }}
{{- include "opennotificaties.tplvalues.render" ( dict "value" .Values.extraVolumes "context" $ ) | nindent 8 }}
{{- end }}
Expand Down
15 changes: 15 additions & 0 deletions charts/opennotificaties/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "opennotificaties.fullname" . }}
labels:
{{- include "opennotificaties.labels" . | nindent 4 }}
spec:
accessModes:
- ReadWriteMany
storageClassName: {{ .Values.persistence.storageClassName }}
resources:
requests:
storage: {{ .Values.persistence.size }}
{{- end }}
13 changes: 13 additions & 0 deletions charts/opennotificaties/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ tolerations: []

affinity: {}

persistence:
enabled: true
size: 512Mi
storageClassName: ""
existingClaim: null
mediaMountSubpath: opennotificaties/media

# Existing Secret must be defined for AzureVaultSecret to work
existingSecret: null

Expand Down Expand Up @@ -181,6 +188,12 @@ settings:
historyLimit: 1
resources: {}

# -- The maximum number of automatic retries. After this amount of retries, Open Notificaties stops trying to deliver the message. Application default is 5.
maxRetries: ""
# -- If specified, a factor applied to the exponential backoff. This allows you to tune how quickly automatic retries are performed. Application default is 3.
retryBackoff: ""
# -- An upper limit to the exponential backoff time. Application default is 48.
retryBackoffMax: ""

# -- Generate secret key at https://djecrety.ir/
secretKey: ""
Expand Down

0 comments on commit 25ad79c

Please sign in to comment.