[skip-ci] mob
This commit is contained in:
parent
00ab3c3e2f
commit
1d635a1068
3 changed files with 22 additions and 9 deletions
|
@ -17,15 +17,16 @@
|
||||||
(and (string? input)
|
(and (string? input)
|
||||||
(not (nil? (re-matches #"(?=^.{4,253}\.?$)(^((?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,63}\.?$)" input)))))
|
(not (nil? (re-matches #"(?=^.{4,253}\.?$)(^((?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,63}\.?$)" input)))))
|
||||||
|
|
||||||
(s/def ::user-name bash-env-string?)
|
(s/def ::keycloak-admin-user bash-env-string?)
|
||||||
(s/def ::user-password string?)
|
(s/def ::keycloak-admin-password string?)
|
||||||
|
(s/def ::postgres-db-user bash-env-string?)
|
||||||
(s/def ::fqdn fqdn-string?)
|
(s/def ::fqdn fqdn-string?)
|
||||||
(s/def ::issuer #{:prod :staging})
|
(s/def ::issuer #{:prod :staging})
|
||||||
|
|
||||||
(def config? (s/keys :req-un [::fqdn]
|
(def config? (s/keys :req-un [::fqdn]
|
||||||
:opt-un [::issuer]))
|
:opt-un [::issuer]))
|
||||||
|
|
||||||
(def auth? (s/keys :req-un [::user-name ::user-password]))
|
(def auth? (s/keys :req-un [::keycloak-admin-user ::keycloak-admin-password]))
|
||||||
|
|
||||||
(defn replace-all-matching-values-by-new-value
|
(defn replace-all-matching-values-by-new-value
|
||||||
[coll value-to-match value-to-replace]
|
[coll value-to-match value-to-replace]
|
||||||
|
@ -44,11 +45,11 @@
|
||||||
(yaml/from-string (yaml/load-resource "postgres/postgres-config.yaml")))
|
(yaml/from-string (yaml/load-resource "postgres/postgres-config.yaml")))
|
||||||
|
|
||||||
(defn generate-deployment [my-auth]
|
(defn generate-deployment [my-auth]
|
||||||
(let [{:keys [user-name user-password]} my-auth]
|
(let [{:keys [keycloak-admin-user keycloak-admin-password]} my-auth]
|
||||||
(->
|
(->
|
||||||
(yaml/from-string (yaml/load-resource "deployment.yaml"))
|
(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 0 :value] keycloak-admin-user)
|
||||||
(assoc-in [:spec :template :spec :containers 0 :env 1 :value] user-password))))
|
(assoc-in [:spec :template :spec :containers 0 :env 1 :value] keycloak-admin-password))))
|
||||||
|
|
||||||
(defn generate-postgres-deployment [my-auth]
|
(defn generate-postgres-deployment [my-auth]
|
||||||
(let [{:keys [postgres-user postgres-password postgres-db]} my-auth]
|
(let [{:keys [postgres-user postgres-password postgres-db]} my-auth]
|
||||||
|
|
|
@ -19,10 +19,22 @@ spec:
|
||||||
- name: keycloak
|
- name: keycloak
|
||||||
image: quay.io/keycloak/keycloak:13.0.0
|
image: quay.io/keycloak/keycloak:13.0.0
|
||||||
env:
|
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
|
- name: KEYCLOAK_USER
|
||||||
value: "admin"
|
value: admin
|
||||||
- name: KEYCLOAK_PASSWORD
|
- name: KEYCLOAK_PASSWORD
|
||||||
value: "admin"
|
value: admin
|
||||||
- name: PROXY_ADDRESS_FORWARDING
|
- name: PROXY_ADDRESS_FORWARDING
|
||||||
value: "true"
|
value: "true"
|
||||||
ports:
|
ports:
|
||||||
|
|
|
@ -20,7 +20,7 @@ spec:
|
||||||
- name: POSTGRES_USER
|
- name: POSTGRES_USER
|
||||||
value: "psql-user"
|
value: "psql-user"
|
||||||
- name: POSTGRES_DB
|
- name: POSTGRES_DB
|
||||||
value: "psql-db"
|
value: "keycloak"
|
||||||
- name: POSTGRES_PASSWORD
|
- name: POSTGRES_PASSWORD
|
||||||
value: "psql-pw"
|
value: "psql-pw"
|
||||||
ports:
|
ports:
|
||||||
|
|
Loading…
Reference in a new issue