Installing the custom metrics autoscaler
You can use the OKD web console to install the Custom Metrics Autoscaler Operator.
The installation creates the following five CRDs:
ClusterTriggerAuthentication
KedaController
ScaledJob
ScaledObject
TriggerAuthentication
Installing the custom metrics autoscaler
You can use the following procedure to install the Custom Metrics Autoscaler Operator.
Prerequisites
Ensure that you have downloaded the pull secret from the Red Hat OpenShift Cluster Manager 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 OKD to use Red Hat Operators.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:
$ oc delete crd scaledobjects.keda.k8s.io
$ oc delete crd triggerauthentications.keda.k8s.io
Procedure
In the OKD web console, click Operators → OperatorHub.
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. OKD 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 thecustom-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:
$ oc get all -n openshift-keda
The output appears similar to the following:
Example output
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
Install the
KedaController
custom resource, which creates the required CRDs:In the OKD web console, click Operators → Installed Operators.
Click Custom Metrics Autoscaler.
On the Operator Details page, click the KedaController tab.
On the KedaController tab, click Create KedaController and edit the file.
kind: KedaController
apiVersion: keda.sh/v1alpha1
metadata:
name: keda
namespace: openshift-keda
spec:
watchNamespace: '' (1)
operator:
logLevel: info (2)
logEncoder: console (3)
metricsServer:
logLevel: '0' (4)
auditConfig: (5)
logFormat: "json"
logOutputVolumeClaim: "persistentVolumeClaimName"
policy:
rules:
- level: Metadata
omitStages: "RequestReceived"
omitManagedFields: false
lifetime:
maxAge: "2"
maxBackup: "1"
maxSize: "50"
serviceAccount: {}
1 Specifies the namespaces that the custom autoscaler should watch. Enter names in a comma-separated list. Omit or set empty to watch all namespaces. The default is empty. 2 Specifies the level of verbosity for the Custom Metrics Autoscaler Operator log messages. The allowed values are debug
,info
,error
. The default isinfo
.3 Specifies the logging format for the Custom Metrics Autoscaler Operator log messages. The allowed values are console
orjson
. The default isconsole
.4 Specifies the logging level for the Custom Metrics Autoscaler Metrics Server. The allowed values are 0
forinfo
and4
ordebug
. The default is0
.5 Activates audit logging for the Custom Metrics Autoscaler Operator and specifies the audit policy to use, as described in the “Configuring audit logging” section. Click Create to create the KEDA controller.