From 3f71d54a979d166e339a92e2e7f4d24f3cdd20a2 Mon Sep 17 00:00:00 2001 From: CarlosEDP Date: Wed, 30 May 2018 11:01:02 -0500 Subject: [PATCH] Updated SMTP user/password generation/storage --- manifests/smtp-server/create_secret.sh | 10 ++++++++++ manifests/smtp-server/smtp.yaml | 10 ++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100755 manifests/smtp-server/create_secret.sh diff --git a/manifests/smtp-server/create_secret.sh b/manifests/smtp-server/create_secret.sh new file mode 100755 index 0000000..f29ae38 --- /dev/null +++ b/manifests/smtp-server/create_secret.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +echo "Please enter your Gmail account"; +read username; + +echo "Please enter your Gmail password"; +read -s password; + +echo "Creating secret" +kubectl create secret generic smtp-account -n monitoring --from-literal=username=${username} --from-literal=password=${password} diff --git a/manifests/smtp-server/smtp.yaml b/manifests/smtp-server/smtp.yaml index 08edafa..b2f6f16 100644 --- a/manifests/smtp-server/smtp.yaml +++ b/manifests/smtp-server/smtp.yaml @@ -33,9 +33,15 @@ spec: protocol: TCP env: - name: GMAIL_USER - value: "youremail@gmail.com" + valueFrom: + secretKeyRef: + name: smtp-account + key: username - name: GMAIL_PASSWORD - value: "yourpassword" + valueFrom: + secretKeyRef: + name: smtp-account + key: password - name: DISABLE_IPV6 value: "True" - name: RELAY_DOMAINS