Skip to content

Commit 301b506

Browse files
authored
Merge pull request #78275 from mburke5678/cma-custom-ca
WIP: OSDOCS11271: Unable to specify custom CAs for Custom Metrics Autoscaler
2 parents 1ad3650 + 3fa1483 commit 301b506

File tree

3 files changed

+46
-9
lines changed

3 files changed

+46
-9
lines changed

modules/nodes-cma-autoscaling-custom-install.adoc

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ $ oc delete crd scaledobjects.keda.k8s.io
3131
$ oc delete crd triggerauthentications.keda.k8s.io
3232
----
3333
34+
* 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:
35+
+
36+
[source,terminal]
37+
----
38+
$ oc create configmap -n openshift-keda thanos-cert --from-file=ca-cert.pem
39+
----
40+
3441
.Procedure
3542

3643
. In the {product-title} web console, click *Operators* -> *OperatorHub*.
@@ -96,9 +103,12 @@ spec:
96103
operator:
97104
logLevel: info <2>
98105
logEncoder: console <3>
106+
caConfigMaps: <4>
107+
- thanos-cert
108+
- kafka-cert
99109
metricsServer:
100-
logLevel: '0' <4>
101-
auditConfig: <5>
110+
logLevel: '0' <5>
111+
auditConfig: <6>
102112
logFormat: "json"
103113
logOutputVolumeClaim: "persistentVolumeClaimName"
104114
policy:
@@ -115,7 +125,8 @@ spec:
115125
<1> Specifies a single namespace in which the Custom Metrics Autoscaler Operator should scale applications. Leave it blank or leave it empty to scale applications in all namespaces. This field should have a namespace or be empty. The default value is empty.
116126
<2> Specifies the level of verbosity for the Custom Metrics Autoscaler Operator log messages. The allowed values are `debug`, `info`, `error`. The default is `info`.
117127
<3> Specifies the logging format for the Custom Metrics Autoscaler Operator log messages. The allowed values are `console` or `json`. The default is `console`.
118-
<4> Specifies the logging level for the Custom Metrics Autoscaler Metrics Server. The allowed values are `0` for `info` and `4` or `debug`. The default is `0`.
119-
<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.
128+
<4> Optional: Specifies one or more config maps with CA certificates, which the Custom Metrics Autoscaler Operator can use to connect securely to TLS-enabled metrics sources.
129+
<5> Specifies the logging level for the Custom Metrics Autoscaler Metrics Server. The allowed values are `0` for `info` and `4` or `debug`. The default is `0`.
130+
<6> Activates audit logging for the Custom Metrics Autoscaler Operator and specifies the audit policy to use, as described in the "Configuring audit logging" section.
120131

121132
.. Click *Create* to create the KEDA controller.

modules/sd-nodes-cma-autoscaling-custom-install.adoc

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ $ oc delete crd triggerauthentications.keda.k8s.io
3434
3535
* Ensure that the `keda` namespace exists. If not, you must manaully create the `keda` namespace.
3636
37+
* 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:
38+
+
39+
[source,terminal]
40+
----
41+
$ oc create configmap -n openshift-keda thanos-cert --from-file=ca-cert.pem
42+
----
43+
3744
.Procedure
3845

3946
. In the {product-title} web console, click *Operators* -> *OperatorHub*.
@@ -110,9 +117,12 @@ spec:
110117
operator:
111118
logLevel: info <2>
112119
logEncoder: console <3>
120+
caConfigMaps: <4>
121+
- thanos-cert
122+
- kafka-cert
113123
metricsServer:
114-
logLevel: '0' <4>
115-
auditConfig: <5>
124+
logLevel: '0' <5>
125+
auditConfig: <6>
116126
logFormat: "json"
117127
logOutputVolumeClaim: "persistentVolumeClaimName"
118128
policy:
@@ -129,7 +139,8 @@ spec:
129139
<1> Specifies a single namespace in which the Custom Metrics Autoscaler Operator should scale applications. Leave it blank or leave it empty to scale applications in all namespaces. This field should have a namespace or be empty. The default value is empty.
130140
<2> Specifies the level of verbosity for the Custom Metrics Autoscaler Operator log messages. The allowed values are `debug`, `info`, `error`. The default is `info`.
131141
<3> Specifies the logging format for the Custom Metrics Autoscaler Operator log messages. The allowed values are `console` or `json`. The default is `console`.
132-
<4> Specifies the logging level for the Custom Metrics Autoscaler Metrics Server. The allowed values are `0` for `info` and `4` or `debug`. The default is `0`.
133-
<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.
142+
<4> Optional: Specifies one or more config maps with CA certificates, which the Custom Metrics Autoscaler Operator can use to connect securely to TLS-enabled metrics sources.
143+
<5> Specifies the logging level for the Custom Metrics Autoscaler Metrics Server. The allowed values are `0` for `info` and `4` or `debug`. The default is `0`.
144+
<6> Activates audit logging for the Custom Metrics Autoscaler Operator and specifies the audit policy to use, as described in the "Configuring audit logging" section.
134145

135146
.. Click *Create* to create the KEDA controller.

nodes/cma/nodes-cma-autoscaling-custom.adoc

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ toc::[]
88

99
As a developer, you can use Custom Metrics Autoscaler Operator for Red Hat OpenShift to specify how {product-title} should automatically increase or decrease the number of pods for a deployment, stateful set, custom resource, or job based on custom metrics that are not based only on CPU or memory.
1010

11-
The Custom Metrics Autoscaler Operator is an optional operator, based on the Kubernetes Event Driven Autoscaler (KEDA), that allows workloads to be scaled using additional metrics sources other than pod metrics.
11+
The Custom Metrics Autoscaler Operator is an optional Operator, based on the Kubernetes Event Driven Autoscaler (KEDA), that allows workloads to be scaled using additional metrics sources other than pod metrics.
1212

1313
The custom metrics autoscaler currently supports only the Prometheus, CPU, memory, and Apache Kafka metrics.
1414

@@ -52,3 +52,18 @@ image::564_OpenShift_Custom_Metrics_Autoscaler_0224.png[Custom metrics autoscale
5252
6. As a it operates, a workload can affect the scaling metrics. For example, if a workload is scaled up to handle work in a Kafka queue, the queue size decreases after the workload processes all the work. As a result, the workload is scaled down.
5353
5454
7. If the metrics are in a range specified by the `minReplicaCount` value, the custom metrics autoscaler controller disables all scaling, and leaves the replica count at a fixed level. If the metrics exceed that range, the custom metrics autoscaler controller enables scaling and allows the HPA to scale the workload. While scaling is disabled, the HPA does not take any action.
55+
56+
[id="nodes-cma-autoscaling-custom-ca_{context}"]
57+
== Custom CA certificates for the Custom Metrics Autoscaler
58+
59+
By default, the Custom Metrics Autoscaler Operator uses automatically-generated service CA certificate to connect to on-cluster services.
60+
61+
If you want to use off-cluster services that require custom CA certificates, you can add the required certificates to a config map. Then, add the config map to the `KedaController` custom resource as described in xref:../../nodes/cma/nodes-cma-autoscaling-custom-install.adoc#nodes-cma-autoscaling-custom-install[Installing the custom metrics autoscaler]. The Operator loads those certificates on start-up and registers them as trusted by the Operator.
62+
63+
The config maps can contain one or more certificate files that contain one or more PEM-encoded CA certificates. Or, you can use separate config maps for each certificate file.
64+
65+
[NOTE]
66+
====
67+
If you later update the config map to add additional certificates, you must restart the `keda-operator-*` pod for the changes to take effect.
68+
====
69+

0 commit comments

Comments
 (0)