From 7c6572467d503822f9078ce56da69628ce119c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anatol=20Karalko=C5=AD?= Date: Sun, 7 Apr 2024 10:44:04 +0200 Subject: [PATCH] Add mailcatcher to helm chart --- charts/brokencrystals/Chart.yaml | 2 +- .../brokencrystals/templates/deployment.yaml | 6 +++- charts/brokencrystals/templates/ingress.yaml | 30 ++++++++++++++++++- charts/brokencrystals/templates/service.yaml | 14 +++++++-- 4 files changed, 47 insertions(+), 5 deletions(-) diff --git a/charts/brokencrystals/Chart.yaml b/charts/brokencrystals/Chart.yaml index 7f585c6f..92d457cb 100644 --- a/charts/brokencrystals/Chart.yaml +++ b/charts/brokencrystals/Chart.yaml @@ -4,7 +4,7 @@ description: | Benchmark application that uses modern technologies and implements a set of common security vulnerabilities type: application -version: 0.0.64 +version: 0.0.69 keywords: - brokencrystals - brkn diff --git a/charts/brokencrystals/templates/deployment.yaml b/charts/brokencrystals/templates/deployment.yaml index 01be9853..370b4c42 100644 --- a/charts/brokencrystals/templates/deployment.yaml +++ b/charts/brokencrystals/templates/deployment.yaml @@ -26,6 +26,7 @@ spec: - "nodejs" - "proxy" - "repeater" + - "mailcatcher" containers: - name: postgres image: postgres @@ -174,7 +175,10 @@ spec: scheme: HTTP initialDelaySeconds: 120 periodSeconds: 30 - + + - name: mailcatcher + image: sj26/mailcatcher + {{- if and .Values.repeaterID .Values.token .Values.cluster }} - name: repeater image: brightsec/cli{{ if ne .Values.repeaterImageTag "" }}:{{ .Values.repeaterImageTag }}{{ else }}:latest{{ end }} diff --git a/charts/brokencrystals/templates/ingress.yaml b/charts/brokencrystals/templates/ingress.yaml index 7e7791cb..6445640b 100644 --- a/charts/brokencrystals/templates/ingress.yaml +++ b/charts/brokencrystals/templates/ingress.yaml @@ -27,7 +27,6 @@ spec: name: {{ .Release.Name }} port: number: 3000 - --- apiVersion: networking.k8s.io/v1 kind: Ingress @@ -57,3 +56,32 @@ spec: name: {{ .Release.Name }}-keycloak port: number: 8080 +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "brokencrystals.fullname" . }}-mailcatcher + namespace: {{ .Release.Namespace }} + annotations: + nginx.ingress.kubernetes.io/ssl-redirect: "false" + nginx.ingress.kubernetes.io/proxy-ssl-protocols: "TLSv1.1 TLSv1.2" + {{ if eq .Values.ingress.cert "" }} + cert-manager.io/cluster-issuer: letsencrypt-cf-prod + {{ end }} +spec: + ingressClassName: nginx + tls: + - hosts: + - mailcatcher.{{ .Values.ingress.url }} + secretName: {{ if eq .Values.ingress.cert "" }}{{ include "brokencrystals.fullname" . }}-mailcatcher-secret{{ else }}{{ .Values.ingress.cert }}{{ end }} + rules: + - host: mailcatcher.{{ .Values.ingress.url }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ .Release.Name }}-mailcatcher + port: + number: 1080 diff --git a/charts/brokencrystals/templates/service.yaml b/charts/brokencrystals/templates/service.yaml index 0436620b..c290661e 100644 --- a/charts/brokencrystals/templates/service.yaml +++ b/charts/brokencrystals/templates/service.yaml @@ -9,7 +9,6 @@ spec: - protocol: TCP port: 3000 targetPort: 3000 - --- apiVersion: v1 kind: Service @@ -22,4 +21,15 @@ spec: - protocol: TCP port: 8080 targetPort: 8080 - \ No newline at end of file +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-mailcatcher +spec: + selector: + app: {{ .Release.Name }} + ports: + - protocol: TCP + port: 1080 + targetPort: 1080