From a2d99c98317822af87d08641993c7ce7500ca948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Mon, 24 Jun 2019 12:53:22 +0200 Subject: [PATCH 1/5] Write kubernetes deployment for dummy mailserver --- .../https/templates/ingress.template.yaml | 8 +++++ .../mailserver/deployment-mailserver.yaml | 34 +++++++++++++++++++ .../mailserver/service-mailserver.yaml | 17 ++++++++++ .../templates/configmap.template.yaml | 4 +++ 4 files changed, 63 insertions(+) create mode 100644 deployment/human-connection/mailserver/deployment-mailserver.yaml create mode 100644 deployment/human-connection/mailserver/service-mailserver.yaml 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/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..b2d2bc1d6 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: "http://mailserver.human-connection" + SMTP_PORT: "25" + SMTP_USERNAME: "" + SMTP_PASSWORD: "" GRAPHQL_PORT: "4000" GRAPHQL_URI: "http://nitro-backend.human-connection:4000" MOCKS: "false" From dd1d77f2bbd5426b87bcbb32cc661421b99b0f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Mon, 24 Jun 2019 12:56:57 +0200 Subject: [PATCH 2/5] Add env to configmap --- deployment/human-connection/templates/configmap.template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/human-connection/templates/configmap.template.yaml b/deployment/human-connection/templates/configmap.template.yaml index b2d2bc1d6..10bc09213 100644 --- a/deployment/human-connection/templates/configmap.template.yaml +++ b/deployment/human-connection/templates/configmap.template.yaml @@ -7,7 +7,7 @@ SMTP_USERNAME: "" SMTP_PASSWORD: "" GRAPHQL_PORT: "4000" - GRAPHQL_URI: "http://nitro-backend.human-connection:4000" + GRAPHQL_URI: "http://backend.human-connection:4000" MOCKS: "false" NEO4J_URI: "bolt://nitro-neo4j.human-connection:7687" NEO4J_USER: "neo4j" From ce0e3cb520f57c5d73a58b3752e0ec4073506ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Mon, 24 Jun 2019 13:15:05 +0200 Subject: [PATCH 3/5] Write documentation for mailserver deployment --- SUMMARY.md | 1 + .../human-connection/mailserver/README.md | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 deployment/human-connection/mailserver/README.md 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/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. From 6ce96d906bb0fe421d01bf7fb4821161d4f5032a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Mon, 24 Jun 2019 13:31:13 +0200 Subject: [PATCH 4/5] Fix configmap template --- deployment/human-connection/templates/configmap.template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/human-connection/templates/configmap.template.yaml b/deployment/human-connection/templates/configmap.template.yaml index 10bc09213..b2d2bc1d6 100644 --- a/deployment/human-connection/templates/configmap.template.yaml +++ b/deployment/human-connection/templates/configmap.template.yaml @@ -7,7 +7,7 @@ SMTP_USERNAME: "" SMTP_PASSWORD: "" GRAPHQL_PORT: "4000" - GRAPHQL_URI: "http://backend.human-connection:4000" + GRAPHQL_URI: "http://nitro-backend.human-connection:4000" MOCKS: "false" NEO4J_URI: "bolt://nitro-neo4j.human-connection:7687" NEO4J_USER: "neo4j" From 91e7e2adafd2ea575d844435b4b49f59d61599ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Mon, 24 Jun 2019 14:49:45 +0200 Subject: [PATCH 5/5] The protocol is not supposed to go into SMTP_HOST --- deployment/human-connection/templates/configmap.template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/human-connection/templates/configmap.template.yaml b/deployment/human-connection/templates/configmap.template.yaml index b2d2bc1d6..762901ae8 100644 --- a/deployment/human-connection/templates/configmap.template.yaml +++ b/deployment/human-connection/templates/configmap.template.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap data: - SMTP_HOST: "http://mailserver.human-connection" + SMTP_HOST: "mailserver.human-connection" SMTP_PORT: "25" SMTP_USERNAME: "" SMTP_PASSWORD: ""