diff --git a/mailpit_chart/Chart.yaml b/mailpit_chart/Chart.yaml new file mode 100644 index 0000000..ca1c1b4 --- /dev/null +++ b/mailpit_chart/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +name: mailpit +description: A simple Helm Chart for mailpit + +type: application + +version: 0.1.0 diff --git a/mailpit_chart/templates/deployment.yaml b/mailpit_chart/templates/deployment.yaml new file mode 100644 index 0000000..a590227 --- /dev/null +++ b/mailpit_chart/templates/deployment.yaml @@ -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: {} \ No newline at end of file diff --git a/mailpit_chart/templates/mapping.yml b/mailpit_chart/templates/mapping.yml new file mode 100644 index 0000000..77441a8 --- /dev/null +++ b/mailpit_chart/templates/mapping.yml @@ -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 }} \ No newline at end of file diff --git a/mailpit_chart/templates/service.yaml b/mailpit_chart/templates/service.yaml new file mode 100644 index 0000000..6a17918 --- /dev/null +++ b/mailpit_chart/templates/service.yaml @@ -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 diff --git a/regtech_mail_api/api.py b/regtech_mail_api/api.py index 31f6221..d769c4e 100644 --- a/regtech_mail_api/api.py +++ b/regtech_mail_api/api.py @@ -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: