keycloak deployment now may work

This commit is contained in:
jem 2021-05-21 17:59:44 +02:00
parent af57b9dd20
commit f2871aa383
4 changed files with 10 additions and 12 deletions

View file

@ -46,7 +46,7 @@
config-valid? (s/valid? core/config? config-edn)
auth-valid? (s/valid? core/auth? auth-edn)]
(if (and config-valid? auth-valid?)
(println (core/generate config-str auth-str))
(println (core/generate config-edn auth-edn))
(do
(when (not config-valid?)
(println

View file

@ -32,17 +32,16 @@
(assoc-in [:data :config.edn] (str my-config))
(assoc-in [ :data :credentials.edn] (str my-auth))))
(defn generate-deployment [config]
(let [user (:user config)
password (:password config)]
(defn generate-deployment [my-auth]
(let [{:keys [user-name user-password]} my-auth]
(->
(yaml/from-string (yaml/load-resource "deployment.yaml"))
(assoc-in [:spec :template :spec :containers]
[{:name "keycloak"
:image "quay.io/keycloak/keycloak:13.0.0"
:env
[{:name "KEYCLOAK_USER", :value user}
{:name "KEYCLOAK_PASSWORD", :value password}
[{:name "KEYCLOAK_USER", :value user-name}
{:name "KEYCLOAK_PASSWORD", :value user-password}
{:name "PROXY_ADDRESS_FORWARDING", :value "true"}]
:ports [{:name "http", :containerPort 8080}]
:readinessProbe {:httpGet {:path "/auth/realms/master", :port 8080}}}]))))
@ -78,10 +77,10 @@
(cs/join "\n"
[(yaml/to-string (generate-config my-config my-auth))
"---"
(yaml/to-string (generate-certificate))
(yaml/to-string (generate-certificate my-config))
"---"
(yaml/to-string (generate-ingress))
(yaml/to-string (generate-ingress my-config))
"---"
(yaml/to-string (generate-service))
"---"
(yaml/to-string (generate-deployment))]))
(yaml/to-string (generate-deployment my-auth))]))

View file

@ -81,4 +81,4 @@
{:name "PROXY_ADDRESS_FORWARDING", :value "true"}]
:ports [{:name "http", :containerPort 8080}]
:readinessProbe {:httpGet {:path "/auth/realms/master", :port 8080}}}]}}}}
(cut/generate-deployment {:user "testuser" :password "test1234"}))))
(cut/generate-deployment {:user-name "testuser" :user-password "test1234"}))))

View file

@ -1,2 +1 @@
{:fqdn "test.de"
:issuer :prod}
{:fqdn "keycloak.test.meissa-gmbh.de"}