Fix deployment test
This commit is contained in:
parent
83817bdb2c
commit
7193a34365
1 changed files with 32 additions and 34 deletions
|
@ -18,63 +18,61 @@
|
||||||
(cut/generate-secret {:keycloak-admin-user "user" :keycloak-admin-password "password"}))))
|
(cut/generate-secret {:keycloak-admin-user "user" :keycloak-admin-password "password"}))))
|
||||||
|
|
||||||
(deftest should-generate-deployment
|
(deftest should-generate-deployment
|
||||||
(is (= {:apiVersion "apps/v1"
|
(is (= {:apiVersion "apps/v1",
|
||||||
:kind "Deployment"
|
:kind "Deployment",
|
||||||
:metadata
|
:metadata
|
||||||
{:name "keycloak" :namespace "default" :labels {:app "keycloak"}},
|
{:name "keycloak", :namespace "default", :labels {:app "keycloak"}},
|
||||||
:spec
|
:spec
|
||||||
{:replicas 1
|
{:replicas 1,
|
||||||
:selector {:matchLabels {:app "keycloak"}}
|
:selector {:matchLabels {:app "keycloak"}},
|
||||||
:template
|
:template
|
||||||
{:metadata {:labels {:app "keycloak"}}
|
{:metadata {:labels {:app "keycloak"}},
|
||||||
:spec
|
:spec
|
||||||
{:containers
|
{:containers
|
||||||
[{:name "keycloak"
|
[{:name "keycloak",
|
||||||
:image "quay.io/keycloak/keycloak:20.0.3"
|
:image "quay.io/keycloak/keycloak:20.0.3",
|
||||||
:imagePullPolicy "IfNotPresent"
|
:imagePullPolicy "IfNotPresent",
|
||||||
:args ["start"]
|
:args ["start"],
|
||||||
:volumeMounts
|
:volumeMounts
|
||||||
[{:name "keycloak-cert"
|
[{:name "keycloak-cert",
|
||||||
:mountPath "/etc/certs"
|
:mountPath "/etc/certs",
|
||||||
:readOnly true}]
|
:readOnly true}],
|
||||||
:env
|
:env
|
||||||
[{:name "KC_HTTPS_CERTIFICATE_FILE"
|
[{:name "KC_HTTPS_CERTIFICATE_FILE",
|
||||||
:value "/etc/certs/tls.crt"}
|
:value "/etc/certs/tls.crt"}
|
||||||
{:name "KC_HTTPS_CERTIFICATE_KEY_FILE"
|
{:name "KC_HTTPS_CERTIFICATE_KEY_FILE",
|
||||||
:value "/etc/certs/tls.key"}
|
:value "/etc/certs/tls.key"}
|
||||||
{:name "KC_HOSTNAME" :value "test.de"}
|
{:name "KC_HOSTNAME", :value "test.de"}
|
||||||
{:name "DB_VENDOR" :value "POSTGRES"}
|
{:name "KC_PROXY", :value "edge"}
|
||||||
{:name "DB_ADDR" :value "postgresql-service"}
|
{:name "DB_VENDOR", :value "POSTGRES"}
|
||||||
{:name "DB_SCHEMA" :value "public"}
|
{:name "DB_ADDR", :value "postgresql-service"}
|
||||||
{:name "DB_DATABASE"
|
{:name "DB_SCHEMA", :value "public"}
|
||||||
|
{:name "DB_DATABASE",
|
||||||
:valueFrom
|
:valueFrom
|
||||||
{:configMapKeyRef
|
{:configMapKeyRef
|
||||||
{:name "postgres-config", :key "postgres-db"}}}
|
{:name "postgres-config", :key "postgres-db"}}}
|
||||||
{:name "DB_USER"
|
{:name "DB_USER",
|
||||||
:valueFrom
|
:valueFrom
|
||||||
{:secretKeyRef
|
{:secretKeyRef
|
||||||
{:name "postgres-secret", :key "postgres-user"}}}
|
{:name "postgres-secret", :key "postgres-user"}}}
|
||||||
{:name "DB_PASSWORD"
|
{:name "DB_PASSWORD",
|
||||||
:valueFrom
|
:valueFrom
|
||||||
{:secretKeyRef
|
{:secretKeyRef
|
||||||
{:name "postgres-secret" :key "postgres-password"}}}
|
{:name "postgres-secret", :key "postgres-password"}}}
|
||||||
{:name "PROXY_ADDRESS_FORWARDING", :value "true"}
|
{:name "KEYCLOAK_ADMIN",
|
||||||
{:name "KEYCLOAK_USER"
|
|
||||||
:valueFrom
|
:valueFrom
|
||||||
{:secretKeyRef
|
{:secretKeyRef
|
||||||
{:name "keycloak-secret", :key "keycloak-user"}}}
|
{:name "keycloak-secret", :key "keycloak-user"}}}
|
||||||
{:name "KEYCLOAK_PASSWORD"
|
{:name "KEYCLOAK_ADMIN_PASSWORD",
|
||||||
:valueFrom
|
:valueFrom
|
||||||
{:secretKeyRef
|
{:secretKeyRef
|
||||||
{:name "keycloak-secret" :key "keycloak-password"}}}]
|
{:name "keycloak-secret", :key "keycloak-password"}}}],
|
||||||
:ports [{:name "http" :containerPort 8080}]
|
:ports [{:name "http", :containerPort 8080}]}],
|
||||||
:readinessProbe
|
|
||||||
{:httpGet {:path "/auth/realms/master", :port 8080}}}]
|
|
||||||
:volumes
|
:volumes
|
||||||
[{:name "keycloak-cert"
|
[{:name "keycloak-cert",
|
||||||
:secret
|
:secret
|
||||||
{:secretName "keycloak"
|
{:secretName "keycloak",
|
||||||
:items
|
:items
|
||||||
[{:key "tls.crt" :path "tls.crt"}
|
[{:key "tls.crt", :path "tls.crt"}
|
||||||
{:key "tls.key" :path "tls.key"}]}}]}}}}
|
{:key "tls.key", :path "tls.key"}]}}]}}}}
|
||||||
(cut/generate-deployment {:fqdn "test.de"}))))
|
(cut/generate-deployment {:fqdn "test.de"}))))
|
||||||
|
|
Loading…
Reference in a new issue