grafana-watcher: allow credentials from env variable

This commit is contained in:
Frederic Branczyk
2017-04-06 15:24:22 +02:00
parent b3716f5b7e
commit 066b04322d
4 changed files with 56 additions and 4 deletions

View File

@@ -0,0 +1,20 @@
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 user password"
exit 1
fi
user=$1
password=$2
cat <<-EOF
apiVersion: v1
kind: Secret
metadata:
name: grafana-credentials
data:
user: $(echo -n ${user} | base64 --wrap=0)
password: $(echo -n ${password} | base64 --wrap=0)
EOF