Operator installation guide

This commit is contained in:
andreaTP 2022-04-13 11:50:25 +01:00 committed by Bruno Oliveira da Silva
parent 046935b9e1
commit 73f8909bd8
6 changed files with 50 additions and 11 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

View file

@ -68,7 +68,7 @@ spec:
- port: 5432
targetPort: 5432
EOF
kubectl|oc apply -f example-postgres.yaml
kubectl apply -f example-postgres.yaml
----
==== Hostname
@ -135,7 +135,7 @@ spec:
hostname: test.keycloak.org
tlsSecret: example-tls-secret
EOF
kubectl|oc apply -f example-kc.yaml
kubectl apply -f example-kc.yaml
----
And you can check that the Keycloak instance has been provisioned in the cluster by looking at the status of the created CR:

View file

@ -5,14 +5,48 @@
<@tmpl.guide
title="Keycloak Operator Installation"
summary="How to install the Keycloak Operator on Kubernetes">
TODO: https://github.com/keycloak/keycloak/issues/10786
summary="How to install the Keycloak Operator on Kubernetes and OpenShift">
== Keycloak Operator Installation
In this guide we will show how to install the Keycloak Operator in your Kubernetes or OpenShift cluster.
=== OpenShift Installation
=== OLM Installation
You can install the Keycloak Operator in Kubernetes environment is to use Operator Lifecycle Manager (OLM).
Before moving on, make sure you have OLM installed, if not follow this https://github.com/operator-framework/operator-lifecycle-manager/blob/master/doc/install/install.md#install-a-release[guide].
To install the Keycloak Operator follow the https://olm.operatorframework.io/docs/tasks/install-operator-with-olm/[instructions].
In the default Catalogs the Keycloak Operator is named `keycloak-operator` and make sure to use the `candidate` channel.
==== OpenShift UI
On OpenShift you can use a conveninet UI on top of OLM.
Navigate `Home` → `Operators` → `OperatorHub` in the menu on the left side of the OpenShift Console.
Then, focus on the search input box and type "keycloak":
image::{generatedGuideImages}/select-operator.jpeg["Select the Keycloak Operator in the UI"]
Next, navigate to Keycloak Operator and click on it. Next, follow the instructions on the screen, make sure you are installing from the `candidate` channel:
image::{generatedGuideImages}/configure-operator.jpeg["Configure Keycloak Operator"]
=== Vanilla Kubernetes Installation
To install the operator on a vanilla Kubernetes cluster, you need first to install the CRDs:
[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
----
And then install the Keycloak Operator deployment:
[source,bash,subs="attributes+"]
----
kubectl apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/{version}/kubernetes/kubernetes.yml
----
Currently the operator watches only the same namespace as it's installed.
</@tmpl.guide>

View file

@ -64,7 +64,7 @@ spec:
displayName: ExampleRealm
enabled: true
EOF
kubectl|oc apply -f example-realm-import.yaml
kubectl apply -f example-realm-import.yaml
----
And you can check the progress of the Import by running:

View file

@ -6,6 +6,7 @@ import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.codehaus.plexus.util.FileUtils;
import java.io.File;
@ -30,12 +31,16 @@ public class GuideMojo extends AbstractMojo {
targetDir.mkdirs();
}
if (srcDir.getName().equals("images")) {
FileUtils.copyDirectory(srcDir, targetDir);
} else {
log.info("Guide dir: " + srcDir.getAbsolutePath());
log.info("Target dir: " + targetDir.getAbsolutePath());
GuideBuilder g = new GuideBuilder(srcDir, targetDir, log);
g.build();
}
}
} catch (Exception e) {
e.printStackTrace();
throw new MojoFailureException("Failed to generated asciidoc files", e);