From d395d30a8359d3f23536454a573f0c9dbe81be08 Mon Sep 17 00:00:00 2001 From: "Mateus Berardo S. Terra" Date: Thu, 13 Oct 2022 16:54:10 +0000 Subject: [PATCH] Add secrets; adjust grafana update strategy --- build.sh | 2 +- main.jsonnet | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 741cd93..2ecd5a1 100755 --- a/build.sh +++ b/build.sh @@ -18,7 +18,7 @@ rm -rf manifests mkdir -p manifests/setup # Calling gojsontoyaml is optional, but we would like to generate yaml, not json -jsonnet -J vendor -m manifests "${1-main.jsonnet}" | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml' -- {} +jsonnet -J vendor -m manifests --ext-str "GITHUB_CLIENT_ID=$GITHUB_CLIENT_ID" --ext-str "GITHUB_CLIENT_SECRET=$GITHUB_CLIENT_SECRET" "${1-main.jsonnet}" | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml' -- {} # Make sure to remove json files find manifests -type f ! -name '*.yaml' -delete diff --git a/main.jsonnet b/main.jsonnet index 43b44cf..1172ada 100644 --- a/main.jsonnet +++ b/main.jsonnet @@ -33,8 +33,8 @@ local kp = (import 'kube-prometheus/main.libsonnet') + 'auth.github': { enabled: true, allow_sign_up: true, - client_id: '...', - client_secret: '...', + client_id: std.extVar('GITHUB_CLIENT_ID'), + client_secret: std.extVar('GITHUB_CLIENT_SECRET'), scopes: 'user:email,read:org', auth_url: 'https://github.com/login/oauth/authorize', token_url: 'https://github.com/login/oauth/access_token', @@ -155,6 +155,9 @@ local kp = (import 'kube-prometheus/main.libsonnet') + grafana+:: { deployment+: { spec+: { + strategy+:{ + type: "Recreate" + }, template+: { spec+: { volumes: std.map(