From d0585fd2b7b04f34afab6d11e15ef3632ce6f6aa Mon Sep 17 00:00:00 2001 From: Stephan Lo Date: Thu, 20 Mar 2025 23:47:53 +0100 Subject: [PATCH] feat(mailhog): IPCEICIS-3048 - mailhog deployed, ingress is https:///mailhog, forgje is configured --- template/stacks/core/forgejo/values.yaml | 6 ++++ .../stacks/core/ingress-apps/mailhog.yaml | 18 ++++++++++ .../stacks/ref-implementation/mailhog.yaml | 25 ++++++++++++++ .../mailhog/deployment.yaml | 33 +++++++++++++++++++ .../ref-implementation/mailhog/service.yaml | 13 ++++++++ 5 files changed, 95 insertions(+) create mode 100644 template/stacks/core/ingress-apps/mailhog.yaml create mode 100644 template/stacks/ref-implementation/mailhog.yaml create mode 100644 template/stacks/ref-implementation/mailhog/deployment.yaml create mode 100644 template/stacks/ref-implementation/mailhog/service.yaml diff --git a/template/stacks/core/forgejo/values.yaml b/template/stacks/core/forgejo/values.yaml index 1bf35c2..0cb06cd 100644 --- a/template/stacks/core/forgejo/values.yaml +++ b/template/stacks/core/forgejo/values.yaml @@ -27,6 +27,12 @@ gitea: server: DOMAIN: '{{{ .Env.DOMAIN_GITEA }}}' ROOT_URL: 'https://{{{ .Env.DOMAIN_GITEA }}}:443' + mailer: + ENABLED: true + FROM: forgejo@{{{ .Env.DOMAIN_GITEA }}} + PROTOCOL: smtp + SMTP_ADDR: mailhog.mailhog.svc.cluster.local + SMTP_PORT: 1025 service: ssh: diff --git a/template/stacks/core/ingress-apps/mailhog.yaml b/template/stacks/core/ingress-apps/mailhog.yaml new file mode 100644 index 0000000..ceb6060 --- /dev/null +++ b/template/stacks/core/ingress-apps/mailhog.yaml @@ -0,0 +1,18 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: mailhog + namespace: mailhog +spec: + ingressClassName: nginx + rules: + - host: {{{ .Env.DOMAIN }}} + http: + paths: + - backend: + service: + name: mailhog + port: + number: 8025 + path: /mailhog + pathType: Prefix diff --git a/template/stacks/ref-implementation/mailhog.yaml b/template/stacks/ref-implementation/mailhog.yaml new file mode 100644 index 0000000..6fd77df --- /dev/null +++ b/template/stacks/ref-implementation/mailhog.yaml @@ -0,0 +1,25 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: mailhog + namespace: argocd + labels: + env: dev + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + source: + repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder + targetRevision: HEAD + path: "stacks/ref-implementation/mailhog" + destination: + server: "https://kubernetes.default.svc" + namespace: mailhog + syncPolicy: + syncOptions: + - CreateNamespace=true + automated: + selfHeal: true + retry: + limit: -1 diff --git a/template/stacks/ref-implementation/mailhog/deployment.yaml b/template/stacks/ref-implementation/mailhog/deployment.yaml new file mode 100644 index 0000000..b5023ac --- /dev/null +++ b/template/stacks/ref-implementation/mailhog/deployment.yaml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mailhog-deployment + namespace: mailhog +spec: + replicas: 1 + selector: + matchLabels: + app: mailhog + template: + metadata: + labels: + app: mailhog + spec: + containers: + - name: mailhog + image: mailhog/mailhog + env: + - name: MH_UI_WEB_PATH # set this to same value as in ingress stacks/core/ingress-apps/mailhog.yaml + value: mailhog + ports: + - containerPort: 1025 + name: smtp + - containerPort: 8025 + name: http + resources: + requests: + memory: "64Mi" + cpu: "50m" + limits: + memory: "128Mi" + cpu: "100m" \ No newline at end of file diff --git a/template/stacks/ref-implementation/mailhog/service.yaml b/template/stacks/ref-implementation/mailhog/service.yaml new file mode 100644 index 0000000..77781c8 --- /dev/null +++ b/template/stacks/ref-implementation/mailhog/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: mailhog +spec: + selector: + app: mailhog + ports: + - name: smtp + port: 1025 + - name: http + port: 8025 + type: ClusterIP \ No newline at end of file