Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tolerations and local storage to the deployment #26

Merged
merged 3 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion helm-charts/inbucket/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Disposable webmail server (similar to Mailinator) with built in SMT
name: inbucket
type: application
appVersion: 3.0.0
version: 2.2.2
version: 2.3.0
keywords:
- inbucket
- mail
Expand Down
7 changes: 7 additions & 0 deletions helm-charts/inbucket/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,10 @@ Return if ingress supports pathType.
{{- define "inbucket.ingress.supportsPathType" -}}
{{- or (eq (include "inbucket.ingress.isStable" .) "true") (and (eq (include "inbucket.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) -}}
{{- end -}}

{{/*
Return if persistence is enabled.
*/}}
{{- define "inbucket.persistenceEnabled" -}}
{{- and ( and ( hasKey .Values "persistence" ) ( hasKey .Values.persistence "enabled" ) ) ( eq .Values.persistence.enabled true ) -}}
{{- end -}}
17 changes: 17 additions & 0 deletions helm-charts/inbucket/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- $persistence := eq (include "inbucket.persistenceEnabled" .) "true" -}}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -54,7 +55,23 @@ spec:
timeoutSeconds: 5
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- if $persistence }}
volumeMounts:
- mountPath: {{ .Values.persistence.path }}
name: {{ include "inbucket.fullname" . }}
readOnly: false
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{ toYaml .Values.tolerations | indent 6 }}
{{- end }}
{{- if $persistence}}
volumes:
- name: {{ include "inbucket.fullname" . }}
persistentVolumeClaim:
claimName: {{ include "inbucket.fullname" . }}
{{- end }}
18 changes: 18 additions & 0 deletions helm-charts/inbucket/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if eq (include "inbucket.persistenceEnabled" .) "true" }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "inbucket.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "inbucket.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "inbucket.chart" . }}
spec:
accessModes:
- {{ default .Values.persistence.accessMode "ReadWriteOnce" }}
resources:
requests:
storage: {{ .Values.persistence.size }}
storageClassName: {{ .Values.persistence.className }}
{{- end }}
7 changes: 7 additions & 0 deletions helm-charts/inbucket/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,10 @@ ingress:

podAnnotations: {}
resources: {}

persistence:
enabled: false
path: /storage
size: 1Gi
className:
accessMode: ReadWriteOnce