In this guide we will show how to install the Keycloak Operator in your Kubernetes or OpenShift cluster.
The recommended way to install the Keycloak Operator in Kubernetes environments is to use the Operator Lifecycle Manager (OLM).
Make sure OLM is installed in your environment. For Guidance on how to install OLM, follow this guide.
The Keycloak Operator OLM package can be installed from the OLM catalog. For general instructions on how to install operators using OLM, follow the instructions on the OLM page.
In the default Catalog, the Keycloak Operator is named
keycloak-operator. Make sure to use the
candidate channel to find the operator.
On OpenShift, use the built-in OLM UI to install the Keycloak Operator.
OperatorHub using the menu on the left side of the OpenShift Console.
Search for "keycloak" on the search input box:
Select the Keycloak Operator from the list of results. After that, follow the instructions on the screen. Make sure you are installing from the
To install the operator on a vanilla Kubernetes cluster, you first need to install its CRDs by running the following commands:
kubectl apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/19.0.3/kubernetes/keycloaks.k8s.keycloak.org-v1.yml kubectl apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/19.0.3/kubernetes/keycloakrealmimports.k8s.keycloak.org-v1.yml
After successfull CRD installation, install the Keycloak Operator deployment by running the following command:
kubectl apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/19.0.3/kubernetes/kubernetes.yml
Currently the operator watches only the namespace where the operator is installed.