From 4d14d4631164333747a5fc9f81309e165e2dc816 Mon Sep 17 00:00:00 2001 From: CarlosEDP Date: Fri, 2 Mar 2018 20:42:15 -0500 Subject: [PATCH] Added SMTP notification for grafana --- manifests/grafana/grafana-configmap.yaml | 9 ++++ manifests/smtp-server/smtp.yaml | 62 ++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 manifests/smtp-server/smtp.yaml diff --git a/manifests/grafana/grafana-configmap.yaml b/manifests/grafana/grafana-configmap.yaml index 144f55b..6e6eb13 100644 --- a/manifests/grafana/grafana-configmap.yaml +++ b/manifests/grafana/grafana-configmap.yaml @@ -21,3 +21,12 @@ data: [auth.anonymous] enabled = false + + [smtp] + enabled = true + host = 192.168.1.50:30025 + user = + password = + from_address = 'carlosedp@gmail.com' + from_name = Grafana Alert + skip_verify = true diff --git a/manifests/smtp-server/smtp.yaml b/manifests/smtp-server/smtp.yaml new file mode 100644 index 0000000..08edafa --- /dev/null +++ b/manifests/smtp-server/smtp.yaml @@ -0,0 +1,62 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + deployment.kubernetes.io/revision: "1" + generation: 1 + labels: + run: smtp-server + name: smtp-server + namespace: monitoring +spec: + replicas: 1 + selector: + matchLabels: + run: smtp-server + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + creationTimestamp: null + labels: + run: smtp-server + spec: + containers: + - image: carlosedp/docker-smtp + imagePullPolicy: Always + name: smtp-server + ports: + - containerPort: 25 + protocol: TCP + env: + - name: GMAIL_USER + value: "youremail@gmail.com" + - name: GMAIL_PASSWORD + value: "yourpassword" + - name: DISABLE_IPV6 + value: "True" + - name: RELAY_DOMAINS + value: ":192.168.0.0/24:10.0.0.0/16" + resources: {} + restartPolicy: Always + replicas: 1 +--- +apiVersion: v1 +kind: Service +metadata: + labels: + run: smtp-server + name: smtp-server + namespace: monitoring +spec: + ports: + - nodePort: 30025 + port: 25 + protocol: TCP + targetPort: 25 + selector: + run: smtp-server + type: NodePort