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

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

You can use the following procedure to install the Custom Metrics Autoscaler Operator.

.Prerequisites
ifdef::openshift-origin[]
* Ensure that you have downloaded the {cluster-manager-url-pull} as shown in _Obtaining the installation program_ in the installation documentation for your platform.
+
If you have the pull secret, add the `redhat-operators` catalog to the OperatorHub custom resource (CR) as shown in _Configuring {product-title} to use Red Hat Operators_.
endif::openshift-origin[]

* Remove any previously-installed Technology Preview versions of the Cluster Metrics Autoscaler Operator.

* Remove any versions of the community-based KEDA.
+
Also, remove the KEDA 1.x custom resource definitions by running the following commands:
+
[source,terminal]
----
$ oc delete crd scaledobjects.keda.k8s.io
----
+
[source,terminal]
----
$ oc delete crd triggerauthentications.keda.k8s.io
----

* 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 example:
+
[source,terminal]
----
$ oc create configmap -n openshift-keda thanos-cert  --from-file=ca-cert.pem
----

.Procedure

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

. Choose *Custom Metrics Autoscaler* from the list of available Operators, and click *Install*.

. On the *Install Operator* page, ensure that the *All namespaces on the cluster (default)* option
is selected for *Installation Mode*. This installs the Operator in all namespaces.

. Ensure that the *openshift-keda* namespace is selected for *Installed Namespace*. {product-title} creates the namespace, if not present in your cluster.

. Click *Install*.

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

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

.. Select the `openshift-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 OpenShift CLI using the following commands:
+
[source,terminal]
----
$ oc get all -n openshift-keda
----
+
The output appears similar to the following:
+
.Example output
[source,terminal]
----
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
----
