2022-03-24 18:44:29 +00:00
<#import "/templates/guide.adoc" as tmpl>
<#import "/templates/kc.adoc" as kc>
<#import "/templates/options.adoc" as opts>
<#import "/templates/links.adoc" as links>
<@tmpl.guide
title="Keycloak Operator Installation"
2022-04-20 08:24:40 +00:00
priority=10
2022-04-13 10:50:25 +00:00
summary="How to install the Keycloak Operator on Kubernetes and OpenShift">
2022-03-24 18:44:29 +00:00
== Keycloak Operator Installation
2022-04-13 10:50:25 +00:00
In this guide we will show how to install the Keycloak Operator in your Kubernetes or OpenShift cluster.
=== OLM Installation
2022-04-19 08:59:35 +00:00
The recommended way to install the Keycloak Operator in Kubernetes environments is to use the Operator Lifecycle Manager (OLM).
2022-04-19 08:56:13 +00:00
==== Prerequisites
Make sure OLM is installed in your environment. For Guidance on how to install OLM, follow this https://github.com/operator-framework/operator-lifecycle-manager/blob/master/doc/install/install.md#install-a-release[guide].
2022-04-13 10:50:25 +00:00
2022-04-19 08:56:34 +00:00
The Keycloak Operator OLM package can be installed from the OLM catalog. For general instructions on how to install operators using OLM, follow the https://olm.operatorframework.io/docs/tasks/install-operator-with-olm/[instructions] on the OLM page.
2022-04-19 08:56:46 +00:00
In the default Catalog, the Keycloak Operator is named `keycloak-operator`. Make sure to use the `candidate` channel to find the operator.
2022-04-13 10:50:25 +00:00
==== OpenShift UI
2022-04-19 08:56:57 +00:00
On OpenShift, use the built-in OLM UI to install the Keycloak Operator.
2022-05-06 16:42:06 +00:00
Navigate to `Home`, `Operators`, `OperatorHub` using the menu on the left side of the OpenShift Console.
2022-04-19 08:57:30 +00:00
Search for "keycloak" on the search input box:
2022-04-13 10:50:25 +00:00
2023-02-09 09:29:41 +00:00
image::select-operator.jpeg["Select the Keycloak Operator in the UI"]
2022-03-24 18:44:29 +00:00
2022-10-21 14:42:42 +00:00
Select the Keycloak Operator from the list of results. After that, follow the instructions on the screen. Make sure you are installing from the `fast` channel:
2022-04-13 10:50:25 +00:00
2023-02-09 09:29:41 +00:00
image::configure-operator.jpeg["Configure Keycloak Operator"]
2022-03-24 18:44:29 +00:00
=== Vanilla Kubernetes Installation
2022-04-19 08:57:24 +00:00
To install the operator on a vanilla Kubernetes cluster, you first need to install its CRDs by running the following commands:
2022-04-13 10:50:25 +00:00
[source,bash,subs="attributes+"]
----
kubectl apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/{version}/kubernetes/keycloaks.k8s.keycloak.org-v1.yml
kubectl apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/{version}/kubernetes/keycloakrealmimports.k8s.keycloak.org-v1.yml
----
2022-08-26 06:07:59 +00:00
After successful CRD installation, install the Keycloak Operator deployment by running the following command:
2022-04-13 10:50:25 +00:00
[source,bash,subs="attributes+"]
----
kubectl apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/{version}/kubernetes/kubernetes.yml
----
2022-04-27 13:49:24 +00:00
Currently the operator watches only the namespace where the operator is installed.
2022-04-13 10:50:25 +00:00
2022-03-24 18:44:29 +00:00
</@tmpl.guide>