[[_installing-operator]] === Installing the {project_operator} on a cluster To install the {project_operator}, you can use: * xref:_install_by_olm[The Operator Lifecycle Manager (OLM)] * xref:_install_by_command[Command line installation] [[_install_by_olm]] ==== Installing using the Operator Lifecycle Manager ifeval::[{project_community}==true] You can install the Operator on an xref:_openshift-olm[OpenShift] or xref:_kubernetes-olm[Kubernetes] cluster. [[_openshift-olm]] ===== Installation on an OpenShift cluster endif::[] .Prerequisites * You have cluster-admin permission or an equivalent level of permissions granted by an administrator. .Procedure Perform this procedure on an OpenShift 4.4 cluster. . Open the OpenShift Container Platform web console. . In the left column, click `Operators, OperatorHub`. . Search for {project_name} Operator. + .OperatorHub tab in OpenShift image:{project_images}/operator-openshift-operatorhub.png[] . Click the {project_name} Operator icon. + An Install page opens. + .Operator Install page on OpenShift image:{project_images}/operator-olm-installation.png[] . Click `Install`. . Select a namespace and click Subscribe. + .Namespace selection in OpenShift image:images/installed-namespace.png[] + The Operator starts installing. When the Operator installation completes, you are ready to create custom resources to install {project_name}, create realms, and perform other adminstrative tasks. ifeval::[{project_community}==true] [[_kubernetes-olm]] ===== Installation on a Kubernetes cluster .Prerequisites * You have cluster-admin permission or an equivalent level of permissions granted by an administrator. .Procedure For a Kubernetes cluster, perform these steps. . Go to link:https://operatorhub.io/operator/keycloak-operator[Keycloak Operator on OperatorHub.io]. . Click `Install`. . Follow the instructions on the screen. + .Operator Install page on Kubernetes image:{project_images}/operator-operatorhub-install.png[] When the Operator installation completes, you are ready to create custom resources to install {project_name}, create realms, and perform other adminstrative tasks. endif::[] .Additional Resources ifeval::[{project_community}==true] * For more information on a Kubernetes installation, see link:https://operatorhub.io/how-to-install-an-operator[How to install an Operator from OperatorHub.io]. * To track what you install and create with the operator, you can now set up a monitoring application. See xref:_monitoring-operator[The Application Monitoring Operator]. endif::[] * For more information on OpenShift Operators, see the link:https://docs.openshift.com/container-platform/4.4/operators/olm-what-operators-are.html[OpenShift Operators guide]. * For more information on OpenShift installation, see link:https://access.redhat.com/documentation/en-us/openshift_container_platform/4.4/html/installing/index[Installing and Configuring OpenShift Container Platform clusters]. [[_install_by_command]] ==== Installing from the command line You can install the {project_operator} from the command line. .Prerequisites You have cluster-admin permission or an equivalent level of permissions granted by an administrator. .Procedure . Obtain the software to install from this location: link:{operatorRepo_link}[Github repo]. . Install all required custom resource definitions: + [source,bash,subs=+attributes] ---- $ {create_cmd} -f deploy/crds/ ---- . Create a new namespace (or reuse an existing one) such as the namespace `myproject`: + [source,bash,subs=+attributes] ---- $ {create_cmd} namespace myproject ---- . Deploy a role, role binding, and service account for the Operator: + [source,bash,subs=+attributes] ---- $ {create_cmd} -f deploy/role.yaml -n myproject $ {create_cmd} -f deploy/role_binding.yaml -n myproject $ {create_cmd} -f deploy/service_account.yaml -n myproject ---- . Deploy the Operator: + [source,bash,subs=+attributes] ---- $ {create_cmd} -f deploy/operator.yaml -n myproject ---- . Confirm that the Operator is running: + [source,bash,subs=+attributes] ---- $ {create_cmd_brief} get deployment keycloak-operator NAME READY UP-TO-DATE AVAILABLE AGE keycloak-operator 1/1 1 1 41s ---- .Additional resources * To create your first custom resource, see xref:_keycloak_cr[{project_name} installation using a custom resource]. ifeval::[{project_community}==true] * If you want to start tracking all Operator activities before creating custom resources, see the xref:_monitoring-operator[Application Monitoring Operator]. endif::[]