grafana - Keep the grafana config in secrets since it now contains the OAuth2 client secret.

Bug: skia:
Change-Id: I11b45eaaa67b1fa252ee8669236873c4065a0900
Reviewed-on: https://skia-review.googlesource.com/c/183942
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
diff --git a/promk/Makefile b/promk/Makefile
index 75d7f27..c5c357a 100644
--- a/promk/Makefile
+++ b/promk/Makefile
@@ -24,7 +24,6 @@
 	cp ./tmp/prometheus-2.2.1.linux-amd64/promtool ./tmp/promtool
 
 push_config: validate skia-public
-	kubectl create configmap grafana-conf --from-file=./grafana -o yaml --dry-run | kubectl replace -f -
 	-rm -rf ./tmpconf
 	mkdir ./tmpconf
 	cp prometheus/prometheus-public.yml ./tmpconf/prometheus.yml
diff --git a/promk/README.md b/promk/README.md
index dad061d..69dc3c7 100644
--- a/promk/README.md
+++ b/promk/README.md
@@ -1,14 +1,19 @@
-grafana
+Grafana
 =======
 
 The grafana.ini file should almost never change, so if it does,
 just delete the pod and have kubernetes restart it so the config
 gets read.
 
+Edit the config file by running the ./edit-grafana-config.sh script.
+
 TODO(jcgregorio) Backup the sqlite database.
 
+Prometheus
+==========
+
 Admins
-======
+------
 
 Before deploying yaml files with service accounts you need to give yourself
 cluster-admin rights:
diff --git a/promk/edit-grafana-config.sh b/promk/edit-grafana-config.sh
new file mode 100755
index 0000000..f17ac6d
--- /dev/null
+++ b/promk/edit-grafana-config.sh
@@ -0,0 +1,16 @@
+#/bin/bash
+
+# Downloads the secret grafana.ini file for editing.
+#
+# Once you are done editing the file, the config will be uploaded.
+SECRET_NAME=grafana-ini
+source ../bash/ramdisk.sh
+cd /tmp/ramdisk
+kubectl get secret ${SECRET_NAME} -o json | jq -r '.data["grafana.ini"]' | base64 -d > grafana.ini
+
+echo "Downloaded the login secrets to /tmp/ramdisk."
+echo "Edit /tmp/ramdisk/grafana.ini."
+echo ""
+read -r -p "When you are done editing press enter to upload the updated grafana.ini file..." key
+kubectl create secret generic ${SECRET_NAME} --from-file=grafana.ini --dry-run -o yaml | kubectl apply -f -
+cd -