Using custom Keycloak images

Keycloak custom image with Operator

The Keycloak Custom Resource (CR) give you the possibility to specify a custom container image for the Keycloak server.

Note:
To ensure full compatibility of Operator and Operand, make sure that the version of Keycloak release used in the custom image is aligned with the version of the operator.

Best Practice

When using the default Keycloak image the server will perform a costly re-augmentation every time a Pod starts. This can be avoided by providing a Custom Image where the augmentation already happened during the build time of the image.

A custom image additionally allows to specify Keycloak’s "build-time" configurations and extensions during the build of the container.

For instructions on how to build such image refer to Running Keycloak in containers.

Providing Custom Keycloak image

To provide a custom image you have to define the image field in the Keycloak CR, for example:

apiVersion: k8s.keycloak.org/v2alpha1
kind: Keycloak
metadata:
  name: example-kc
spec:
  instances: 1
  image: quay.io/my-company/my-keycloak:latest
  hostname: example.com
  tlsSecret: example-tls-secret
Note:
Using custom images, every build time configuration passed through the serverConfiguration key will be ignored.