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

5 create helm charts for regtech mail api and mailpit #13

Merged
merged 4 commits into from
Feb 26, 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
7 changes: 7 additions & 0 deletions mailpit_chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2
name: mailpit
description: A simple Helm Chart for mailpit

type: application

version: 0.1.0
54 changes: 54 additions & 0 deletions mailpit_chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mailpit
namespace: regtech
labels:
mailing.app: mailpit
spec:
replicas: 1
selector:
matchLabels:
mailing.app: mailpit
template:
metadata:
labels:
mailing.app: mailpit
spec:
serviceAccountName: secrets-csi-sa
volumes:
- name: mailing-api-secrets
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: regtech-provider
containers:
- name: mailpit
image: "axllent/mailpit"
imagePullPolicy: Always
volumeMounts:
- name: mailing-api-secrets
mountPath: "/mnt/secrets-store"
readOnly: true
env:
- name: MP_SMTP_AUTH_ACCEPT_ANY
value: "0"
- name: MP_SMTP_AUTH_ALLOW_INSECURE
value: "1"
- name: SMTP_USERNAME
valueFrom:
secretKeyRef:
name: mailing-api-secrets
key: SMTP_USERNAME
- name: SMTP_PASSWORD
valueFrom:
secretKeyRef:
name: mailing-api-secrets
key: SMTP_PASSWORD
- name: MP_SMTP_AUTH
value: "$(SMTP_USERNAME):$(SMTP_PASSWORD)"
ports:
- containerPort: 8025
- containerPort: 1025
resources: {}
13 changes: 13 additions & 0 deletions mailpit_chart/templates/mapping.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.mapping.enabled }}
apiVersion: getambassador.io/v2
kind: Mapping
metadata:
name: mailpit
namespace: regtech
spec:
ambassador_id:
--apiVersion-v3alpha1-only--default
host: {{ .Values.mapping.host }}
prefix: {{ .Values.mapping.prefix }}
service: mailpit
{{- end }}
20 changes: 20 additions & 0 deletions mailpit_chart/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: mailpit
namespace: regtech
labels:
mailing.app: mailpit
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 8025
protocol: TCP
name: http
- port: 1025
targetPort: 1025
protocol: TCP
name: smpt-port
selector:
mailing.app: mailpit
4 changes: 2 additions & 2 deletions regtech_mail_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
mailer = SmtpMailer(
settings.smtp_host, # type: ignore
settings.smtp_port,
settings.smtp_username, # type: ignore
settings.smtp_password, # type: ignore
settings.smtp_username.get_secret_value(), # type: ignore
settings.smtp_password.get_secret_value(), # type: ignore
settings.smtp_use_tls,
)
case EmailMailerType.MOCK:
Expand Down
Loading