Skip to content

Commit 41e0cb8

Browse files
author
Michael Burke
committed
OSDOCS 6789: HPA with custom metrics operator install method and authenticationRef indentation level typo
1 parent e1f5eb4 commit 41e0cb8

6 files changed

+64
-62
lines changed

_topic_maps/_topic_map.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,7 @@ Topics:
22682268
File: nodes-cma-autoscaling-custom-install
22692269
- Name: Understanding the custom metrics autoscaler triggers
22702270
File: nodes-cma-autoscaling-custom-trigger
2271-
- Name: Understanding the custom metrics autoscaler trigger authentications
2271+
- Name: Understanding custom metrics autoscaler trigger authentications
22722272
File: nodes-cma-autoscaling-custom-trigger-auth
22732273
- Name: Pausing the custom metrics autoscaler
22742274
File: nodes-cma-autoscaling-custom-pausing

modules/nodes-cma-autoscaling-custom-creating-job.adoc

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,8 @@ spec:
6565
threshold: '5'
6666
query: sum(rate(http_requests_total{job="test-app"}[1m]))
6767
authModes: "bearer"
68-
- authenticationRef: <14>
69-
name: prom-triggerauthentication
70-
metadata:
71-
name: prom-triggerauthentication
72-
type: object
73-
- authenticationRef: <15>
74-
name: prom-cluster-triggerauthentication
75-
metadata:
68+
authenticationRef: <14>
7669
name: prom-cluster-triggerauthentication
77-
type: object
7870
----
7971
<1> Specifies the maximum duration the job can run.
8072
<2> Specifies the number of retries for a job. The default is `6`.
@@ -99,19 +91,15 @@ spec:
9991
+
10092
<12> Optional: Specifies a scaling strategy: `default`, `custom`, or `accurate`. The default is `default`. For more information, see the link in the "Additional resources" section that follows.
10193
<13> Specifies the trigger to use as the basis for scaling, as described in the "Understanding the custom metrics autoscaler triggers" section.
102-
<14> Optional: Specifies a trigger authentication, as described in the "Creating a custom metrics autoscaler trigger authentication" section.
103-
<15> Optional: Specifies a cluster trigger authentication, as described in the "Creating a custom metrics autoscaler trigger authentication" section.
104-
+
105-
[NOTE]
106-
====
107-
It is not necessary to specify both a namespace trigger authentication and a cluster trigger authentication.
108-
====
94+
<14> Optional: Specifies a trigger authentication or a cluster trigger authentication. For more information, see _Understanding the custom metrics autoscaler trigger authentication_ in the _Additional resources_ section.
95+
* Enter `TriggerAuthentication` to use a trigger authentication. This is the default.
96+
* Enter `ClusterTriggerAuthentication` to use a cluster trigger authentication.
10997

110-
. Create the custom metrics autoscaler:
98+
. Create the custom metrics autoscaler by running the following command:
11199
+
112100
[source,terminal]
113101
----
114-
$ oc create -f <file-name>.yaml
102+
$ oc create -f <filename>.yaml
115103
----
116104

117105
.Verification

modules/nodes-cma-autoscaling-custom-creating-workload.adoc

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,9 @@ spec:
125125
threshold: '5'
126126
query: sum(rate(http_requests_total{job="test-app"}[1m]))
127127
authModes: basic
128-
- authenticationRef: <17>
128+
authenticationRef: <17>
129129
name: prom-triggerauthentication
130-
metadata:
131-
name: prom-triggerauthentication
132-
type: object
133-
- authenticationRef: <18>
134-
name: prom-cluster-triggerauthentication
135-
metadata:
136-
name: prom-cluster-triggerauthentication
137-
type: object
130+
kind: TriggerAuthentication
138131
----
139132
<1> Optional: Specifies that the Custom Metrics Autoscaler Operator is to scale the replicas to the specified value and stop autoscaling, as described in the "Pausing the custom metrics autoscaler for a workload" section.
140133
<2> Specifies a name for this custom metrics autoscaler.
@@ -152,19 +145,15 @@ spec:
152145
<14> Optional: Specifies a name for the horizontal pod autoscaler. The default is `keda-hpa-{scaled-object-name}`.
153146
<15> Optional: Specifies a scaling policy to use to control the rate to scale pods up or down, as described in the "Scaling policies" section.
154147
<16> Specifies the trigger to use as the basis for scaling, as described in the "Understanding the custom metrics autoscaler triggers" section. This example uses {product-title} monitoring.
155-
<17> Optional: Specifies a trigger authentication, as described in the "Creating a custom metrics autoscaler trigger authentication" section.
156-
<18> Optional: Specifies a cluster trigger authentication, as described in the "Creating a custom metrics autoscaler trigger authentication" section.
157-
+
158-
[NOTE]
159-
====
160-
It is not necessary to specify both a namespace trigger authentication and a cluster trigger authentication.
161-
====
148+
<17> Optional: Specifies a trigger authentication or a cluster trigger authentication. For more information, see _Understanding the custom metrics autoscaler trigger authentication_ in the _Additional resources_ section.
149+
* Enter `TriggerAuthentication` to use a trigger authentication. This is the default.
150+
* Enter `ClusterTriggerAuthentication` to use a cluster trigger authentication.
162151

163-
. Create the custom metrics autoscaler:
152+
. Create the custom metrics autoscaler by running the following command:
164153
+
165154
[source,terminal]
166155
----
167-
$ oc create -f <file-name>.yaml
156+
$ oc create -f <filename>.yaml
168157
----
169158

170159
.Verification

modules/nodes-cma-autoscaling-custom-trigger-auth-using.adoc

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ spec:
5454
+
5555
[source,terminal]
5656
----
57-
$ oc create -f <file-name>.yaml
57+
$ oc create -f <filename>.yaml
5858
----
5959

60-
. Create or edit a `ScaledObject` YAML file:
60+
. Create or edit a `ScaledObject` YAML file that uses the trigger authentication:
61+
62+
.. Create a YAML file that defines the object by running the following command:
6163
+
62-
.Example scaled object
64+
.Example scaled object with a trigger authentication
6365
[source,yaml,options="nowrap"]
6466
----
6567
apiVersion: keda.sh/v1alpha1
@@ -74,38 +76,54 @@ spec:
7476
minReplicaCount: 0
7577
pollingInterval: 30
7678
triggers:
77-
- authenticationRef:
78-
type: prometheus
79+
- type: prometheus
7980
metadata:
8081
serverAddress: https://thanos-querier.openshift-monitoring.svc.cluster.local:9092
8182
namespace: kedatest # replace <NAMESPACE>
8283
metricName: http_requests_total
8384
threshold: '5'
8485
query: sum(rate(http_requests_total{job="test-app"}[1m]))
8586
authModes: "basic"
86-
- authenticationRef: <1>
87-
name: prom-triggerauthentication
88-
metadata:
89-
name: prom-triggerauthentication
90-
type: object
91-
- authenticationRef: <2>
92-
name: prom-cluster-triggerauthentication
93-
kind: ClusterTriggerAuthentication
94-
metadata:
95-
name: prom-cluster-triggerauthentication
96-
type: object
87+
authenticationRef:
88+
name: prom-triggerauthentication <1>
89+
kind: TriggerAuthentication <2>
9790
----
98-
<1> Optional: Specify a trigger authentication.
99-
<2> Optional: Specify a cluster trigger authentication. You must include the `kind: ClusterTriggerAuthentication` parameter.
91+
<1> Specify the name of your trigger authentication object.
92+
<2> Specify `TriggerAuthentication`. `TriggerAuthentication` is the default.
10093
+
101-
[NOTE]
102-
====
103-
It is not necessary to specify both a namespace trigger authentication and a cluster trigger authentication.
104-
====
94+
.Example scaled object with a cluster trigger authentication
95+
[source,yaml,options="nowrap"]
96+
----
97+
apiVersion: keda.sh/v1alpha1
98+
kind: ScaledObject
99+
metadata:
100+
name: scaledobject
101+
namespace: my-namespace
102+
spec:
103+
scaleTargetRef:
104+
name: example-deployment
105+
maxReplicaCount: 100
106+
minReplicaCount: 0
107+
pollingInterval: 30
108+
triggers:
109+
- type: prometheus
110+
metadata:
111+
serverAddress: https://thanos-querier.openshift-monitoring.svc.cluster.local:9092
112+
namespace: kedatest # replace <NAMESPACE>
113+
metricName: http_requests_total
114+
threshold: '5'
115+
query: sum(rate(http_requests_total{job="test-app"}[1m]))
116+
authModes: "basic"
117+
authenticationRef:
118+
name: prom-cluster-triggerauthentication <1>
119+
kind: ClusterTriggerAuthentication <2>
120+
----
121+
<1> Specify the name of your trigger authentication object.
122+
<2> Specify `ClusterTriggerAuthentication`.
105123

106-
. Create the object. For example:
124+
.. Create the scaled object by running the following command:
107125
+
108126
[source,terminal]
109127
----
110-
$ oc apply -f <file-name>
128+
$ oc apply -f <filename>
111129
----

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,10 @@ include::modules/nodes-cma-autoscaling-custom-creating-workload.adoc[leveloffset
1919
ifndef::openshift-rosa,openshift-dedicated[]
2020
include::modules/nodes-cma-autoscaling-custom-creating-job.adoc[leveloffset=+1]
2121
endif::openshift-rosa,openshift-dedicated[]
22+
23+
[role="_additional-resources"]
24+
[id="nodes-cma-autoscaling-custom-adding-additional-resources"]
25+
== Additional resources
26+
27+
* xref:../../nodes/cma/nodes-cma-autoscaling-custom-trigger-auth.adoc#nodes-cma-autoscaling-custom-trigger-auth[Understanding custom metrics autoscaler trigger authentications]
28+

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
:_content-type: ASSEMBLY
22
:context: nodes-cma-autoscaling-custom-trigger
33
[id="nodes-cma-autoscaling-custom-overview-trigger"]
4-
= Understanding the custom metrics autoscaler triggers
4+
= Understanding custom metrics autoscaler triggers
55
include::_attributes/common-attributes.adoc[]
66

77
toc::[]

0 commit comments

Comments
 (0)