Skip to content

Commit 971f6c1

Browse files
authored
Merge pull request #58186 from mburke5678/cma-bump-level
Make CMA docs its own chapter in Nodes book
2 parents 8116b3f + 9411ec3 commit 971f6c1

File tree

40 files changed

+702
-492
lines changed

40 files changed

+702
-492
lines changed

_topic_maps/_topic_map.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,8 +2258,6 @@ Topics:
22582258
Distros: openshift-enterprise,openshift-origin
22592259
- Name: Automatically scaling pods with the horizontal pod autoscaler
22602260
File: nodes-pods-autoscaling
2261-
- Name: Automatically scaling pods with the custom metrics autoscaler
2262-
File: nodes-pods-autoscaling-custom
22632261
- Name: Automatically adjust pod resource levels with the vertical pod autoscaler
22642262
File: nodes-pods-vertical-autoscaler
22652263
- Name: Providing sensitive data to pods
@@ -2287,6 +2285,32 @@ Topics:
22872285
File: run-once-duration-override-install
22882286
- Name: Uninstalling the Run Once Duration Override Operator
22892287
File: run-once-duration-override-uninstall
2288+
- Name: Automatically scaling pods with the Custom Metrics Autoscaler Operator
2289+
Dir: cma
2290+
Distros: openshift-enterprise,openshift-origin
2291+
Topics:
2292+
- Name: Custom Metrics Autoscaler Operator overview
2293+
File: nodes-cma-autoscaling-custom
2294+
- Name: Custom Metrics Autoscaler Operator release notes
2295+
File: nodes-cma-autoscaling-custom-rn
2296+
- Name: Installing the custom metrics autoscaler
2297+
File: nodes-cma-autoscaling-custom-install
2298+
- Name: Understanding the custom metrics autoscaler triggers
2299+
File: nodes-cma-autoscaling-custom-trigger
2300+
- Name: Understanding the custom metrics autoscaler trigger authentications
2301+
File: nodes-cma-autoscaling-custom-trigger-auth
2302+
- Name: Pausing the custom metrics autoscaler
2303+
File: nodes-cma-autoscaling-custom-pausing
2304+
- Name: Gathering audit logs
2305+
File: nodes-cma-autoscaling-custom-audit-log
2306+
- Name: Gathering debugging data
2307+
File: nodes-cma-autoscaling-custom-debugging
2308+
- Name: Viewing Operator metrics
2309+
File: nodes-cma-autoscaling-custom-metrics
2310+
- Name: Understanding how to add custom metrics autoscalers
2311+
File: nodes-cma-autoscaling-custom-adding
2312+
- Name: Removing the Custom Metrics Autoscaler Operator
2313+
File: nodes-cma-autoscaling-custom-removing
22902314
- Name: Controlling pod placement onto nodes (scheduling)
22912315
Dir: scheduling
22922316
Distros: openshift-enterprise,openshift-origin

modules/nodes-pods-autoscaling-custom-audit.adoc renamed to modules/nodes-cma-autoscaling-custom-audit.adoc

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
// Module included in the following assemblies:
22
//
3-
// * nodes/nodes-pods-autoscaling-custom.adoc
3+
// * nodes/cma/nodes-cma-autoscaling-custom-audit-log.adoc
44

55
:_content-type: PROCEDURE
6-
[id="nodes-pods-autoscaling-custom-audit_{context}"]
6+
[id="nodes-cma-autoscaling-custom-audit_{context}"]
77
= Configuring audit logging
88

9-
// Text borrowed from gathering-cluster-data.adoc. Make into snippet?
10-
11-
You can gather audit logs, which are a security-relevant chronological set of records documenting the sequence of activities that have affected the system by individual users, administrators, or other components of the system.
12-
13-
For example, audit logs can help you understand where an autoscaling request is coming from. This is key information when backends are getting overloaded by autoscaling requests made by user applications and you need to determine which is the troublesome application. You can configure auditing for the Custom Metrics Autoscaler Operator by editing the `KedaController` custom resource. The logs are sent to an audit log file on a volume that is secured by using a persistent volume claim in the `KedaController` CR.
9+
You can configure auditing for the Custom Metrics Autoscaler Operator by editing the `KedaController` custom resource. The logs are sent to an audit log file on a volume that is secured by using a persistent volume claim in the `KedaController` CR.
1410

1511
// You can view the audit log file directly or use the `oc adm must-gather` CLI. The `oc adm must-gather` CLI collects the log along with other information from your cluster that is most likely needed for debugging issues, such as resource definitions and service logs.
1612

@@ -30,9 +26,9 @@ metadata:
3026
name: keda
3127
namespace: openshift-keda
3228
spec:
33-
...
29+
# ...
3430
metricsServer:
35-
...
31+
# ...
3632
auditConfig:
3733
logFormat: "json" <1>
3834
logOutputVolumeClaim: "pvc-audit-log" <2>

modules/nodes-pods-autoscaling-custom-creating-job.adoc renamed to modules/nodes-cma-autoscaling-custom-creating-job.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Module included in the following assemblies:
22
//
3-
// * nodes/nodes-pods-autoscaling-custom.adoc
3+
// * nodes/cma/nodes-cma-autoscaling-custom-adding.adoc
44

55
:_content-type: PROCEDURE
6-
[id="nodes-pods-autoscaling-custom-creating-job_{context}"]
6+
[id="nodes-cma-autoscaling-custom-creating-job_{context}"]
77
= Adding a custom metrics autoscaler to a job
88

99
You can create a custom metrics autoscaler for any `Job` object.
@@ -132,6 +132,7 @@ scaledjob 100 prometheus prom-triggerauthentication True True 8s
132132
+
133133
Note the following fields in the output:
134134
+
135+
--
135136
* `TRIGGERS`: Indicates the trigger, or scaler, that is being used.
136137
* `AUTHENTICATION`: Indicates the name of any trigger authentication being used.
137138
* `READY`: Indicates whether the scaled object is ready to start scaling:
@@ -140,4 +141,4 @@ Note the following fields in the output:
140141
* `ACTIVE`: Indicates whether scaling is taking place:
141142
** If `True`, scaling is taking place.
142143
** If `False`, scaling is not taking place because there are no metrics or there is a problem in one or more of the objects you created.
143-
144+
--

modules/nodes-pods-autoscaling-custom-creating-workload.adoc renamed to modules/nodes-cma-autoscaling-custom-creating-workload.adoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Module included in the following assemblies:
22
//
3-
// * nodes/nodes-pods-autoscaling-custom.adoc
3+
// * nodes/cma/nodes-cma-autoscaling-custom-adding.adoc
44

55
:_content-type: PROCEDURE
6-
[id="nodes-pods-autoscaling-custom-creating-workload_{context}"]
6+
[id="nodes-cma-autoscaling-custom-creating-workload_{context}"]
77
= Adding a custom metrics autoscaler to a workload
88

99
You can create a custom metrics autoscaler for a workload that is created by a `Deployment`, `StatefulSet`, or `custom resource` object.
@@ -53,7 +53,7 @@ Events: <none>
5353
----
5454
apiVersion: v1
5555
kind: Pod
56-
...
56+
# ...
5757
spec:
5858
containers:
5959
- name: app
@@ -62,6 +62,7 @@ spec:
6262
limits:
6363
memory: "128Mi"
6464
cpu: "500m"
65+
# ...
6566
----
6667

6768
.Procedure
@@ -184,6 +185,7 @@ scaledobject apps/v1.Deployment example-deployment 0 50 promethe
184185
+
185186
Note the following fields in the output:
186187
+
188+
--
187189
* `TRIGGERS`: Indicates the trigger, or scaler, that is being used.
188190
* `AUTHENTICATION`: Indicates the name of any trigger authentication being used.
189191
* `READY`: Indicates whether the scaled object is ready to start scaling:
@@ -195,5 +197,5 @@ Note the following fields in the output:
195197
* `FALLBACK`: Indicates whether the custom metrics autoscaler is able to get metrics from the source
196198
** If `False`, the custom metrics autoscaler is getting metrics.
197199
** If `True`, the custom metrics autoscaler is getting metrics because there are no metrics or there is a problem in one or more of the objects you created.
198-
200+
--
199201

modules/nodes-pods-autoscaling-custom-gather.adoc renamed to modules/nodes-cma-autoscaling-custom-gather.adoc

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,11 @@
11
// Module included in the following assemblies:
22
//
3-
// * nodes/nodes-pods-autoscaling-custom.adoc
3+
// * nodes/cma/nodes-cma-autoscaling-custom-debugging.adoc
44

55
:_content-type: PROCEDURE
6-
[id="nodes-pods-autoscaling-custom-gather_{context}"]
6+
[id="nodes-cma-autoscaling-custom-debugging-gather_{context}"]
77
= Gathering debugging data
88

9-
ifndef::openshift-origin[]
10-
When opening a support case, it is helpful to provide debugging information about your cluster to Red Hat Support.
11-
12-
It is recommended that you provide the following information:
13-
14-
* Data gathered using the `must-gather` tool.
15-
* The unique cluster ID.
16-
endif::openshift-origin[]
17-
18-
You can use the `must-gather` tool to collect data about the Custom Metrics Autoscaler Operator and its components, including:
19-
20-
* The `openshift-keda` namespace and its child objects.
21-
* The Custom Metric Autoscaler Operator installation objects.
22-
* The Custom Metric Autoscaler Operator CRD objects.
23-
249
The following command runs the `must-gather` tool for the Custom Metrics Autoscaler Operator:
2510

2611
[source,terminal]

modules/nodes-pods-autoscaling-custom-install.adoc renamed to modules/nodes-cma-autoscaling-custom-install.adoc

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
11
// Module included in the following assemblies:
22
//
3-
// * nodes/nodes-pods-autoscaling-custom.adoc
3+
// * nodes/cma/nodes-cma-autoscaling-custom-install.adoc
44

55
:_content-type: PROCEDURE
6-
[id="nodes-pods-autoscaling-custom-install_{context}"]
6+
[id="nodes-cma-autoscaling-custom-install_{context}"]
77
= Installing the custom metrics autoscaler
88

9-
You can use the {product-title} web console to install the Custom Metrics Autoscaler Operator.
10-
11-
The installation creates five CRDs:
12-
13-
* `ClusterTriggerAuthentication`
14-
* `KedaController`
15-
* `ScaledJob`
16-
* `ScaledObject`
17-
* `TriggerAuthentication`
9+
You can use the following procedure to install the Custom Metrics Autoscaler Operator.
1810

1911
.Prerequisites
2012
ifdef::openshift-origin[]
2113
* Ensure that you have downloaded the {cluster-manager-url-pull} as shown in _Obtaining the installation program_ in the installation documentation for your platform.
2214
+
2315
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_.
24-
endif::[]
16+
endif::openshift-origin[]
2517

2618
* If you use the community KEDA:
2719

modules/nodes-pods-autoscaling-custom-metrics-access.adoc renamed to modules/nodes-cma-autoscaling-custom-metrics-access.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
// Module included in the following assemblies:
22
//
3-
// * nodes/pods/nodes-pods-autoscaling-custom.adoc
3+
// * nodes/cma/nodes-cma-autoscaling-custom-metrics.adoc
44
// Modeled after migration-accessing-performance-metrics.adoc
55

66
:_content-type: PROCEDURE
7-
[id="nodes-pods-autoscaling-custom-metrics-access_{context}"]
7+
[id="nodes-cma-autoscaling-custom-metrics-access_{context}"]
88
= Accessing performance metrics
99

10-
The Custom Metrics Autoscaler Operator exposes ready-to-use metrics that it pulls from the on-cluster monitoring component. You can query the metrics by using the Prometheus Query Language (PromQL) to analyze and diagnose issues. All metrics are reset when the controller pod restarts.
11-
1210
You can access the metrics and run queries by using the {product-title} web console.
1311

1412
.Procedure

modules/nodes-pods-autoscaling-custom-metrics.adoc renamed to modules/nodes-cma-autoscaling-custom-metrics-provided.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Module included in the following assemblies:
22
//
3-
// * nodes/pods/nodes-pods-autoscaling-custom.adoc
3+
// * nodes/cma/nodes-cma-autoscaling-custom-metrics.adoc
44

55
:_content-type: REFERENCE
6-
[id="nodes-pods-autoscaling-custom-metrics_{context}"]
7-
= Provided metrics
6+
[id="nodes-cma-autoscaling-custom-metrics-provided_{context}"]
7+
= Provided Operator metrics
88

99
The Custom Metrics Autoscaler Operator exposes the following metrics, which you can view by using the {product-title} web console.
1010

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * nodes/cma/nodes-cma-autoscaling-custom-pausing.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="nodes-cma-autoscaling-custom-pausing-restart_{context}"]
7+
= Restarting the custom metrics autoscaler for a scaled object
8+
9+
You can restart a paused custom metrics autoscaler by removing the `autoscaling.keda.sh/paused-replicas` annotation for that `ScaledObject`.
10+
11+
[source,yaml]
12+
----
13+
apiVersion: keda.sh/v1alpha1
14+
kind: ScaledObject
15+
metadata:
16+
annotations:
17+
autoscaling.keda.sh/paused-replicas: "4"
18+
# ...
19+
----
20+
21+
.Procedure
22+
23+
. Use the following command to edit the `ScaledObject` CR for your workload:
24+
+
25+
[source,terminal]
26+
----
27+
$ oc edit ScaledObject scaledobject
28+
----
29+
30+
. Remove the `autoscaling.keda.sh/paused-replicas` annotation.
31+
+
32+
[source,yaml]
33+
----
34+
apiVersion: keda.sh/v1alpha1
35+
kind: ScaledObject
36+
metadata:
37+
annotations:
38+
autoscaling.keda.sh/paused-replicas: "4" <1>
39+
creationTimestamp: "2023-02-08T14:41:01Z"
40+
generation: 1
41+
name: scaledobject
42+
namespace: my-project
43+
resourceVersion: "65729"
44+
uid: f5aec682-acdf-4232-a783-58b5b82f5dd0
45+
----
46+
<1> Remove this annotation to restart a paused custom metrics autoscaler.

modules/nodes-pods-autoscaling-custom-pausing.adoc renamed to modules/nodes-cma-autoscaling-custom-pausing-workload.adoc

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Module included in the following assemblies:
22
//
3-
// * nodes/nodes-pods-autoscaling-custom.adoc
3+
// * nodes/cma/nodes-cma-autoscaling-custom-pausing.adoc
44

55
:_content-type: PROCEDURE
6-
[id="nodes-pods-autoscaling-custom-pausing_{context}"]
7-
= Pausing the custom metrics autoscaler for a workload
6+
[id="nodes-cma-autoscaling-custom-pausing-workload_{context}"]
7+
= Pausing a custom metrics autoscaler
88

9-
You can pause the autoscaling of a workload, as needed, by adding the `autoscaling.keda.sh/paused-replicas` annotation to the custom metrics autoscaler for that workload. The custom metrics autoscaler scales the replicas for that workload to the specified value and pauses autoscaling until the annotation is removed.
9+
You can pause the autoscaling of a scaled object by adding the `autoscaling.keda.sh/paused-replicas` annotation to the custom metrics autoscaler for that scaled object. The custom metrics autoscaler scales the replicas for that workload to the specified value and pauses autoscaling until the annotation is removed.
1010

1111
[source,yaml]
1212
----
@@ -15,13 +15,9 @@ kind: ScaledObject
1515
metadata:
1616
annotations:
1717
autoscaling.keda.sh/paused-replicas: "4"
18-
...
18+
# ...
1919
----
2020

21-
To restart autoscaling, edit the `ScaledObject` CR to remove the annotation.
22-
23-
For example, you might want to pause autoscaling before performing cluster maintenance or to avoid resource starvation by removing non-mission-critical workloads.
24-
2521
.Procedure
2622

2723
. Use the following command to edit the `ScaledObject` CR for your workload:
@@ -44,8 +40,8 @@ metadata:
4440
generation: 1
4541
name: scaledobject
4642
namespace: my-project
47-
resourceVersion: '65729'
48-
uid: 'f5aec682-acdf-4232-a783-58b5b82f5dd0'
43+
resourceVersion: "65729"
44+
uid: f5aec682-acdf-4232-a783-58b5b82f5dd0
4945
----
5046
<1> Specifies that the Custom Metrics Autoscaler Operator is to scale the replicas to the specified value and stop autoscaling.
5147

0 commit comments

Comments
 (0)