From a75829d3b2d19b3b4631d87138c35a7e9baeb494 Mon Sep 17 00:00:00 2001 From: Finn Date: Sun, 14 Jul 2024 22:12:20 -0700 Subject: [PATCH] Custom keycloak image --- containers/keycloak/Containerfile | 18 ++++++++++++++++++ .../login/resources/jankysolutions.css | 19 +++++++++++++++++++ .../jankysolutions/login/theme.properties | 2 ++ k8s/keycloak/deployment.yaml | 13 +++++++++---- 4 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 containers/keycloak/Containerfile create mode 100644 containers/keycloak/themes/jankysolutions/login/resources/jankysolutions.css create mode 100644 containers/keycloak/themes/jankysolutions/login/theme.properties diff --git a/containers/keycloak/Containerfile b/containers/keycloak/Containerfile new file mode 100644 index 0000000..a17d8b4 --- /dev/null +++ b/containers/keycloak/Containerfile @@ -0,0 +1,18 @@ +FROM quay.io/keycloak/keycloak:25.0 as builder + +# Enable health and metrics support +ENV KC_HEALTH_ENABLED=true +ENV KC_METRICS_ENABLED=true + +# Configure a database vendor +ENV KC_DB=postgres + +WORKDIR /opt/keycloak +RUN /opt/keycloak/bin/kc.sh build + +FROM quay.io/keycloak/keycloak:latest +COPY --from=builder /opt/keycloak/ /opt/keycloak/ +ADD themes/jankysolutions /opt/keycloak/themes/jankysolutions + +ENTRYPOINT ["/opt/keycloak/bin/kc.sh"] +CMD ["start", "--cache-stack=kubernetes"] diff --git a/containers/keycloak/themes/jankysolutions/login/resources/jankysolutions.css b/containers/keycloak/themes/jankysolutions/login/resources/jankysolutions.css new file mode 100644 index 0000000..13bc88c --- /dev/null +++ b/containers/keycloak/themes/jankysolutions/login/resources/jankysolutions.css @@ -0,0 +1,19 @@ +.pf-v5-c-login__container { + grid-template-areas: "main"; + grid-template-columns: 34rem; +} + +#kc-header-wrapper { + padding: 62px 10px 20px; + position: absolute; + left: 50%; + transform: translateX(-50%); +} + +.login-pf body { + height: 100%; +} + +div.kc-logo-text span { + display: none; +} diff --git a/containers/keycloak/themes/jankysolutions/login/theme.properties b/containers/keycloak/themes/jankysolutions/login/theme.properties new file mode 100644 index 0000000..7ecc29b --- /dev/null +++ b/containers/keycloak/themes/jankysolutions/login/theme.properties @@ -0,0 +1,2 @@ +parent=keycloak.v2 +styles=jankysolutions.css diff --git a/k8s/keycloak/deployment.yaml b/k8s/keycloak/deployment.yaml index 35775c3..ee32b80 100644 --- a/k8s/keycloak/deployment.yaml +++ b/k8s/keycloak/deployment.yaml @@ -40,12 +40,14 @@ spec: value: "true" - name: KC_METRICS_ENABLED value: "true" + - name: KC_HOSTNAME_URL + value: https://auth-next.janky.solutions/ - name: KC_HOSTNAME - value: https://auth-next.janky.solutions + value: https://auth-next.janky.solutions/ - name: KC_PROXY value: reencrypt - name: KC_PROXY_HEADERS - value: xforwarded + value: forwarded - name: KC_DB value: postgres - name: KC_DB_URL @@ -60,6 +62,10 @@ spec: secretKeyRef: name: keycloak.keycloak-database.credentials.postgresql.acid.zalan.do key: password + - name: KC_LOG_CONSOLE_OUTPUT + value: json + # - name: KC_LOG_LEVEL + # value: "DEBUG" - name: jgroups.dns.query value: keycloak ports: @@ -74,8 +80,7 @@ spec: scheme: HTTPS path: /health/ready port: 9000 - initialDelaySeconds: 60 - periodSeconds: 1 + initialDelaySeconds: 30 volumes: - name: certs secret: