From 1d635a106872ec6d1f8cab8fe93a4ea9cbce9e66 Mon Sep 17 00:00:00 2001 From: jem Date: Fri, 28 May 2021 09:48:28 +0200 Subject: [PATCH] [skip-ci] mob --- src/main/cljc/dda/k8s_keycloak/core.cljc | 13 +++++++------ src/main/resources/deployment.yaml | 16 ++++++++++++++-- .../resources/postgres/postgres-deployment.yaml | 2 +- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/main/cljc/dda/k8s_keycloak/core.cljc b/src/main/cljc/dda/k8s_keycloak/core.cljc index f2be1d1..ce2f4ec 100644 --- a/src/main/cljc/dda/k8s_keycloak/core.cljc +++ b/src/main/cljc/dda/k8s_keycloak/core.cljc @@ -17,15 +17,16 @@ (and (string? input) (not (nil? (re-matches #"(?=^.{4,253}\.?$)(^((?!-)[a-zA-Z0-9-]{1,63}(? (yaml/from-string (yaml/load-resource "deployment.yaml")) - (assoc-in [:spec :template :spec :containers 0 :env 0 :value] user-name) - (assoc-in [:spec :template :spec :containers 0 :env 1 :value] user-password)))) + (assoc-in [:spec :template :spec :containers 0 :env 0 :value] keycloak-admin-user) + (assoc-in [:spec :template :spec :containers 0 :env 1 :value] keycloak-admin-password)))) (defn generate-postgres-deployment [my-auth] (let [{:keys [postgres-user postgres-password postgres-db]} my-auth] diff --git a/src/main/resources/deployment.yaml b/src/main/resources/deployment.yaml index 0517011..d947c02 100644 --- a/src/main/resources/deployment.yaml +++ b/src/main/resources/deployment.yaml @@ -19,10 +19,22 @@ spec: - name: keycloak image: quay.io/keycloak/keycloak:13.0.0 env: + - name: DB_VENDOR + value: POSTGRES + - name: DB_ADDR + value: postgres + - name: DB_DATABASE + value: keycloak + - name: DB_USER + value: keycloak + - name: DB_SCHEMA + value: public + - name: DB_PASSWORD + value: password - name: KEYCLOAK_USER - value: "admin" + value: admin - name: KEYCLOAK_PASSWORD - value: "admin" + value: admin - name: PROXY_ADDRESS_FORWARDING value: "true" ports: diff --git a/src/main/resources/postgres/postgres-deployment.yaml b/src/main/resources/postgres/postgres-deployment.yaml index 49da204..143d376 100644 --- a/src/main/resources/postgres/postgres-deployment.yaml +++ b/src/main/resources/postgres/postgres-deployment.yaml @@ -20,7 +20,7 @@ spec: - name: POSTGRES_USER value: "psql-user" - name: POSTGRES_DB - value: "psql-db" + value: "keycloak" - name: POSTGRES_PASSWORD value: "psql-pw" ports: