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>
2023-08-30 16:21:38 +00:00
<#import "/templates/profile.adoc" as profile>
2022-03-24 18:44:29 +00:00
<@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
2023-03-01 15:24:36 +00:00
== Installing the Keycloak Operator
2023-05-04 09:04:44 +00:00
This {section} describes how to install the Keycloak Operator in a Kubernetes or OpenShift cluster.
2022-04-13 10:50:25 +00:00
2023-03-01 15:24:36 +00:00
=== Installing by using the Operator Lifecycle Manager
2022-04-13 10:50:25 +00:00
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
2023-03-01 15:24:36 +00:00
* Make sure OLM is installed in your environment. For details, see https://github.com/operator-framework/operator-lifecycle-manager/blob/master/doc/install/install.md#install-a-release[Installing OLM].
2022-04-13 10:50:25 +00:00
2023-03-01 15:24:36 +00:00
* Be sure that you have cluster-admin permission or an equivalent level of permissions granted by an administrator.
2022-04-13 10:50:25 +00:00
2023-03-01 15:24:36 +00:00
==== Using the OpenShift web console
2022-04-13 10:50:25 +00:00
2023-03-01 15:24:36 +00:00
The following procedure describes how to install the Keycloak Operator. However, for general instructions on installing Operators using OLM, see https://olm.operatorframework.io/docs/tasks/install-operator-with-olm/[Install your operator with OLM]. In the default Catalog, the Keycloak Operator is named `keycloak-operator`. Make sure to use the `fast` channel to find the operator.
2022-04-13 10:50:25 +00:00
2023-03-01 15:24:36 +00:00
Perform this procedure on an OpenShift cluster.
. Open the OpenShift Container Platform web console.
2022-03-24 18:44:29 +00:00
2023-03-01 15:24:36 +00:00
. In the left column, click *Home*, *Operators*, *OperatorHub*.
2022-04-13 10:50:25 +00:00
2023-03-01 15:24:36 +00:00
. Search for "keycloak" on the search input box.
+
image::select-operator.jpeg["Select the Keycloak Operator in the UI"]
. Select the Keycloak Operator from the list of results.
. Follow the instructions on the screen.
+
Make sure you are installing from the *fast* channel:
+
2023-09-01 06:54:00 +00:00
image::configure-operator.png["Configure Keycloak Operator"]
2022-03-24 18:44:29 +00:00
2023-08-30 16:21:38 +00:00
<@profile.ifCommunity>
2023-03-01 15:24:36 +00:00
=== Installing by using kubectl without Operator Lifecycle Manager
2022-03-24 18:44:29 +00:00
2023-03-01 15:24:36 +00:00
You can install the Operator on a vanilla Kubernetes cluster by using `kubectl` commands:
2022-04-13 10:50:25 +00:00
2023-03-01 15:24:36 +00:00
. Install the CRDs by entering 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
----
2023-03-01 15:24:36 +00:00
. Install the Keycloak Operator deployment by entering 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
----
2023-03-01 15:24:36 +00:00
Currently the Operator watches only the namespace where the Operator is installed.
2023-08-30 16:21:38 +00:00
</@profile.ifCommunity>
2022-04-13 10:50:25 +00:00
2022-03-24 18:44:29 +00:00
</@tmpl.guide>