diff --git a/docs/guides/src/main/images/configure-operator.jpeg b/docs/guides/src/main/images/configure-operator.jpeg new file mode 100644 index 00000000000..a850d58e773 Binary files /dev/null and b/docs/guides/src/main/images/configure-operator.jpeg differ diff --git a/docs/guides/src/main/images/select-operator.jpeg b/docs/guides/src/main/images/select-operator.jpeg new file mode 100644 index 00000000000..5121a9004c1 Binary files /dev/null and b/docs/guides/src/main/images/select-operator.jpeg differ diff --git a/docs/guides/src/main/operator/basic-deployment.adoc b/docs/guides/src/main/operator/basic-deployment.adoc index 053c3f67aae..6839f331256 100644 --- a/docs/guides/src/main/operator/basic-deployment.adoc +++ b/docs/guides/src/main/operator/basic-deployment.adoc @@ -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: diff --git a/docs/guides/src/main/operator/installation.adoc b/docs/guides/src/main/operator/installation.adoc index 902f26be9bb..35138917d6a 100644 --- a/docs/guides/src/main/operator/installation.adoc +++ b/docs/guides/src/main/operator/installation.adoc @@ -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. + diff --git a/docs/guides/src/main/operator/realm-import.adoc b/docs/guides/src/main/operator/realm-import.adoc index 9058009580d..ddf0327bb09 100644 --- a/docs/guides/src/main/operator/realm-import.adoc +++ b/docs/guides/src/main/operator/realm-import.adoc @@ -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: diff --git a/docs/maven-plugin/src/main/java/org/keycloak/guides/maven/GuideMojo.java b/docs/maven-plugin/src/main/java/org/keycloak/guides/maven/GuideMojo.java index 754ce0ff066..cc27a686df2 100644 --- a/docs/maven-plugin/src/main/java/org/keycloak/guides/maven/GuideMojo.java +++ b/docs/maven-plugin/src/main/java/org/keycloak/guides/maven/GuideMojo.java @@ -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,11 +31,15 @@ public class GuideMojo extends AbstractMojo { targetDir.mkdirs(); } - log.info("Guide dir: " + srcDir.getAbsolutePath()); - log.info("Target dir: " + targetDir.getAbsolutePath()); + 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(); + GuideBuilder g = new GuideBuilder(srcDir, targetDir, log); + g.build(); + } } } catch (Exception e) { e.printStackTrace();