Skip to main content

Add the ILM theme

Optionally, you can apply a custom ILM theme to Keycloak. The ILM theme will make the login page for the users to be authenticated by Keycloak look like the login page for the users to be authenticated by the built-in authentication server.

The ILM Keycloak theme is available:

Install theme

Assuming using the official Keycloak container images quay.io/keycloak/keycloak, the ILM Keycloak theme can be installed in the Kubernetes environment using initContainers that will make it available to Keycloak during boot, for example:

apiVersion: apps/v1
kind: Deployment
metadata:
name: keycloak-deployment
labels:
app: keycloak
namespace: keycloak
spec:
replicas: 1
selector:
matchLabels:
app: keycloak
template:
metadata:
labels:
app: keycloak
spec:
initContainers:
- name: init-theme
image: hub.omnitrustregistry.com/ilm/keycloak-theme:0.1.0
command:
- /bin/sh
- -c
- |
cp -a /themes/. /data/
volumeMounts:
- mountPath: /data
name: shared-disk
containers:
- name: keycloak
image: quay.io/keycloak/keycloak:19.0.2
args: ["start-dev", "--import-realm"]
ports:
- name: http
containerPort: 8080
readinessProbe:
httpGet:
path: /realms/master
port: 8080
volumeMounts:
- mountPath: /opt/keycloak/themes
name: shared-disk
readOnly: true
volumes:
- name: shared-disk
emptyDir: {}

Apply theme

Once the theme is installed, it can be applied to the ILM client by setting the Login theme to ilm, see Login settings in the Keycloak documentation.

Keycloak themes

For more information about custom themes, refer to Keycloak Themes documentation.