diff --git a/SUMMARY.md b/SUMMARY.md index 701eac2d0..c281e2fae 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -27,6 +27,7 @@ * [Kubernetes Dashboard](deployment/digital-ocean/dashboard/README.md) * [HTTPS](deployment/digital-ocean/https/README.md) * [Human Connection](deployment/human-connection/README.md) + * [Mailserver](deployment/human-connection/mailserver/README.md) * [Volumes](deployment/volumes/README.md) * [Neo4J Offline-Backups](deployment/volumes/neo4j-offline-backup/README.md) * [Volume Snapshots](deployment/volumes/volume-snapshots/README.md) diff --git a/deployment/digital-ocean/https/templates/ingress.template.yaml b/deployment/digital-ocean/https/templates/ingress.template.yaml index ba4681bc8..9d0068e08 100644 --- a/deployment/digital-ocean/https/templates/ingress.template.yaml +++ b/deployment/digital-ocean/https/templates/ingress.template.yaml @@ -10,6 +10,7 @@ metadata: spec: tls: - hosts: + # - nitro-mailserver.human-connection.org - nitro-staging.human-connection.org secretName: tls rules: @@ -20,3 +21,10 @@ spec: backend: serviceName: nitro-web servicePort: 3000 + # - host: nitro-mailserver.human-connection.org + # http: + # paths: + # - path: / + # backend: + # serviceName: mailserver + # servicePort: 80 diff --git a/deployment/human-connection/mailserver/README.md b/deployment/human-connection/mailserver/README.md new file mode 100644 index 000000000..9a224a3b9 --- /dev/null +++ b/deployment/human-connection/mailserver/README.md @@ -0,0 +1,18 @@ +# Development Mail Server + +You can deploy a fake smtp server which captures all send mails and displays +them in a web interface. The [sample configuration](../templates/configmap.template.yml) +is assuming such a dummy server in the `SMTP_HOST` configuration and points to +a cluster-internal SMTP server. + +To deploy the SMTP server just uncomment the relevant code in the +[ingress server configuration](../../https/templates/ingress.template.yaml) and +run the following: + +```bash +# in folder deployment/human-connection +kubectl apply -f mailserver/ +``` + +You might need to refresh the TLS secret to enable HTTPS on the publicly +available web interface. diff --git a/deployment/human-connection/mailserver/deployment-mailserver.yaml b/deployment/human-connection/mailserver/deployment-mailserver.yaml new file mode 100644 index 000000000..d97a66bc9 --- /dev/null +++ b/deployment/human-connection/mailserver/deployment-mailserver.yaml @@ -0,0 +1,34 @@ +--- + apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + name: mailserver + namespace: human-connection + spec: + replicas: 1 + minReadySeconds: 15 + progressDeadlineSeconds: 60 + selector: + matchLabels: + human-connection.org/selector: deployment-human-connection-mailserver + template: + metadata: + labels: + human-connection.org/selector: deployment-human-connection-mailserver + name: "mailserver" + spec: + containers: + - name: mailserver + image: djfarrelly/maildev + imagePullPolicy: Always + ports: + - containerPort: 80 + - containerPort: 25 + envFrom: + - configMapRef: + name: configmap + - secretRef: + name: human-connection + restartPolicy: Always + terminationGracePeriodSeconds: 30 + status: {} diff --git a/deployment/human-connection/mailserver/service-mailserver.yaml b/deployment/human-connection/mailserver/service-mailserver.yaml new file mode 100644 index 000000000..655488b89 --- /dev/null +++ b/deployment/human-connection/mailserver/service-mailserver.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: mailserver + namespace: human-connection + labels: + human-connection.org/selector: deployment-human-connection-mailserver +spec: + ports: + - name: web + port: 80 + targetPort: 80 + - name: smtp + port: 25 + targetPort: 25 + selector: + human-connection.org/selector: deployment-human-connection-mailserver diff --git a/deployment/human-connection/templates/configmap.template.yaml b/deployment/human-connection/templates/configmap.template.yaml index 87b51a7d3..762901ae8 100644 --- a/deployment/human-connection/templates/configmap.template.yaml +++ b/deployment/human-connection/templates/configmap.template.yaml @@ -2,6 +2,10 @@ apiVersion: v1 kind: ConfigMap data: + SMTP_HOST: "mailserver.human-connection" + SMTP_PORT: "25" + SMTP_USERNAME: "" + SMTP_PASSWORD: "" GRAPHQL_PORT: "4000" GRAPHQL_URI: "http://nitro-backend.human-connection:4000" MOCKS: "false"