// Module included in the following assemblies:
//
// * nodes/cma/nodes-cma-autoscaling-custom-install.adoc

:_mod-docs-content-type: PROCEDURE
[id="sd-nodes-cma-autoscaling-custom-install_{context}"]
= Install the custom metrics autoscaler

[role="_abstract"]
Install the Custom Metrics Autoscaler Operator to enable autoscaling of your workloads based on custom metrics from external sources such as Kafka or Prometheus.

.Prerequisites

* You have access to the cluster as a user with the `cluster-admin` role.
ifdef::openshift-dedicated[]
+
If your {product-title} cluster is in a cloud account that is owned by Red{nbsp}Hat (non-CCS), you must request `cluster-admin` privileges.
endif::openshift-dedicated[]

* Any previously installed Technology Preview versions of the Cluster Metrics Autoscaler Operator are removed.

* Any versions of the community-based KEDA are removed, including the KEDA 1.x custom resource definitions (CRDs). To learn how to delete CRDs, see step 5 in
ifdef::openshift-rosa-hcp[]
link:https://docs.redhat.com/en/documentation/red_hat_openshift_service_on_aws/4/html-single/nodes/index#nodes-cma-autoscaling-custom-uninstalling_nodes-cma-autoscaling-custom-removing[Uninstalling the Custom Metrics Autoscaler Operator].
endif::[]
ifdef::openshift-rosa[]
link:https://docs.redhat.com/en/documentation/red_hat_openshift_service_on_aws_classic_architecture/4/html-single/nodes/index#nodes-cma-autoscaling-custom-uninstalling_nodes-cma-autoscaling-custom-removing[Uninstalling the Custom Metrics Autoscaler Operator].
endif::[]
ifdef::openshift-dedicated[]
link:https://docs.redhat.com/en/documentation/openshift_dedicated/4/html-single/nodes/index#nodes-cma-autoscaling-custom-uninstalling_nodes-cma-autoscaling-custom-removing[Uninstalling the Custom Metrics Autoscaler Operator].
endif::[]

* The `keda` namespace exists. If the namespace does not exist, you must create it manually.

* Optional: If you need the Custom Metrics Autoscaler Operator to connect to off-cluster services, such as an external Kafka cluster or an external Prometheus service, put any required service CA certificates into a config map. The config map must exist in the same namespace where the Operator is installed. For more information, see
ifdef::openshift-rosa-hcp[]
link:https://docs.redhat.com/en/documentation/red_hat_openshift_service_on_aws/4/html-single/nodes/index#nodes-pods-configmap-creating-from-files_configmaps[Creating a config map from a file].
endif::[]
ifdef::openshift-rosa[]
link:https://docs.redhat.com/en/documentation/red_hat_openshift_service_on_aws_classic_architecture/4/html-single/nodes/index#nodes-pods-configmap-creating-from-files_configmaps[Creating a config map from a file].
endif::[]
ifdef::openshift-dedicated[]
link:https://docs.redhat.com/en/documentation/openshift_dedicated/4/html-single/nodes/index#nodes-pods-configmap-creating-from-files_configmaps[Creating a config map from a file].
endif::[]

.Procedure

. In the {product-title} web console, click *Ecosystem* -> *Software Catalog*.

. From the list of available Operators, choose *Custom Metrics Autoscaler*, and click *Install*.

. On the *Install Operator* page, ensure that the *A specific namespace on the cluster* option is selected for *Installation Mode*.

. For *Installed Namespace*, click *Select a namespace*.

. Click *Select Project*:
+
* If the `keda` namespace exists, select *keda* from the list.
* If the `keda` namespace does not exist:
+
.. Select *Create Project* to open the *Create Project* window.
.. In the *Name* field, enter `keda`.
.. In the *Display Name* field, enter a descriptive name, such as `keda`.
.. Optional: In the *Display Name* field, add a description for the namespace.
.. Click *Create*.

. Click *Install*.

. Verify the installation by listing the Custom Metrics Autoscaler Operator components:

.. Navigate to *Workloads* -> *Pods*.

.. Select the `keda` project from the drop-down menu and verify that the `custom-metrics-autoscaler-operator-*` pod is running.

.. Navigate to *Workloads* -> *Deployments* to verify that the `custom-metrics-autoscaler-operator` deployment is running.

. Optional: Verify the installation in the {oc-first} using the following command:
+
[source,terminal]
----
$ oc get all -n keda
----
+
*Example output*
+
[source,text]
----
NAME                                                      READY   STATUS    RESTARTS   AGE
pod/custom-metrics-autoscaler-operator-5fd8d9ffd8-xt4xp   1/1     Running   0          18m

NAME                                                 READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/custom-metrics-autoscaler-operator   1/1     1            1           18m

NAME                                                            DESIRED   CURRENT   READY   AGE
replicaset.apps/custom-metrics-autoscaler-operator-5fd8d9ffd8   1         1         1       18m
----

