Skip to content

Commit 4b737f5

Browse files
author
Michael Burke
committed
OSDOCS10896: Update Custom Metrics Autoscaler documentation for ClusterTriggerAuthentication implementation
1 parent a2e5bcb commit 4b737f5

File tree

2 files changed

+46
-23
lines changed

2 files changed

+46
-23
lines changed

modules/nodes-cma-autoscaling-custom-prometheus-config.adoc

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
You can use the installed {product-title} Prometheus monitoring as a source for the metrics used by the custom metrics autoscaler. However, there are some additional configurations you must perform.
1010

11+
For your scaled objects to be able to read the {product-title} Prometheus metrics, you must use a trigger authentication or a cluster trigger authentication in order to provide the authentication information required. The following procedure differs depending on which trigger authentication method you use. For more information on trigger authentications, see "Understanding custom metrics autoscaler trigger authentications".
12+
1113
[NOTE]
1214
====
1315
These steps are not required for an external Prometheus source.
@@ -32,12 +34,16 @@ You must perform the following tasks, as described in this section:
3234
3335
.Procedure
3436

35-
. Change to the project with the object you want to scale:
37+
. Change to the appropriate project:
3638
+
3739
[source,terminal]
3840
----
39-
$ oc project my-project
41+
$ oc project <project_name> <1>
4042
----
43+
<1> Specifies one of the following projects:
44+
+
45+
* If you are using a trigger authentication, specify the project with the object you want to scale.
46+
* If you are using a cluster trigger authentication, specify the `openshift-keda` project.
4147

4248
. Create a service account and token, if your cluster does not have one:
4349

@@ -47,7 +53,6 @@ $ oc project my-project
4753
----
4854
$ oc create serviceaccount thanos <1>
4955
----
50-
+
5156
<1> Specifies the name of the service account.
5257

5358
.. Create a `secret` YAML to generate a service account token:
@@ -62,7 +67,6 @@ metadata:
6267
kubernetes.io/service-account.name: thanos <1>
6368
type: kubernetes.io/service-account-token
6469
----
65-
+
6670
<1> Specifies the name of the service account.
6771

6872
.. Create the secret object by using the following command:
@@ -86,7 +90,7 @@ $ oc describe serviceaccount thanos <1>
8690
[source,terminal]
8791
----
8892
Name: thanos
89-
Namespace: my-project
93+
Namespace: <namespace_name>
9094
Labels: <none>
9195
Annotations: <none>
9296
Image pull secrets: thanos-dockercfg-nnwgj
@@ -105,22 +109,27 @@ Events: <none>
105109
[source,yaml]
106110
----
107111
apiVersion: keda.sh/v1alpha1
108-
kind: TriggerAuthentication
112+
kind: <authentication_method> <1>
109113
metadata:
110114
name: keda-trigger-auth-prometheus
111115
spec:
112-
secretTargetRef: <1>
113-
- parameter: bearerToken <2>
114-
name: thanos-token <3>
115-
key: token <4>
116+
secretTargetRef: <2>
117+
- parameter: bearerToken <3>
118+
name: thanos-token <4>
119+
key: token <5>
116120
- parameter: ca
117121
name: thanos-token
118122
key: ca.crt
119123
----
120-
<1> Specifies that this object uses a secret for authorization.
121-
<2> Specifies the authentication parameter to supply by using the token.
122-
<3> Specifies the name of the token to use.
123-
<4> Specifies the key in the token to use with the specified parameter.
124+
<1> Specifies one of the following trigger authentication methods:
125+
+
126+
* If you are using a trigger authentication, specify `TriggerAuthentication`. This example configures a trigger authentication.
127+
* If you are using a cluster trigger authentication, specify `ClusterTriggerAuthentication`.
128+
+
129+
<2> Specifies that this object uses a secret for authorization.
130+
<3> Specifies the authentication parameter to supply by using the token.
131+
<4> Specifies the name of the token to use.
132+
<5> Specifies the key in the token to use with the specified parameter.
124133

125134
.. Create the CR object:
126135
+
@@ -171,23 +180,32 @@ $ oc create -f <file-name>.yaml
171180
[source,yaml]
172181
----
173182
apiVersion: rbac.authorization.k8s.io/v1
174-
kind: RoleBinding
183+
kind: <binding_type> <1>
175184
metadata:
176-
name: thanos-metrics-reader <1>
177-
namespace: my-project <2>
185+
name: thanos-metrics-reader <2>
186+
namespace: my-project <3>
178187
roleRef:
179188
apiGroup: rbac.authorization.k8s.io
180189
kind: Role
181190
name: thanos-metrics-reader
182191
subjects:
183192
- kind: ServiceAccount
184-
name: thanos <3>
185-
namespace: my-project <4>
193+
name: thanos <4>
194+
namespace: <namespace_name> <5>
186195
----
187-
<1> Specifies the name of the role you created.
188-
<2> Specifies the namespace of the object you want to scale.
189-
<3> Specifies the name of the service account to bind to the role.
190-
<4> Specifies the namespace of the object you want to scale.
196+
<1> Specifies one of the following object types:
197+
+
198+
* If you are using a trigger authentication, specify `RoleBinding`.
199+
* If you are using a cluster trigger authentication, specify `ClusterRoleBinding`.
200+
+
201+
<2> Specifies the name of the role you created.
202+
<3> Specifies one of the following projects:
203+
+
204+
* If you are using a trigger authentication, specify the project with the object you want to scale.
205+
* If you are using a cluster trigger authentication, specify the `openshift-keda` project.
206+
+
207+
<4> Specifies the name of the service account to bind to the role.
208+
<5> Specifies the project where you previously created the service account.
191209

192210
.. Create the CR object:
193211
+

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ You can configure a certificate authority xref:../../nodes/cma/nodes-cma-autosca
2323

2424
include::modules/nodes-cma-autoscaling-custom-trigger-prom.adoc[leveloffset=+1]
2525
include::modules/nodes-cma-autoscaling-custom-prometheus-config.adoc[leveloffset=+2]
26+
27+
[role="_additional-resources"]
28+
.Additional resources
29+
* xref:../../nodes/cma/nodes-cma-autoscaling-custom-trigger-auth.adoc#nodes-cma-autoscaling-custom-trigger-auth[Understanding custom metrics autoscaler trigger authentications]
30+
2631
include::modules/nodes-cma-autoscaling-custom-trigger-cpu.adoc[leveloffset=+1]
2732
include::modules/nodes-cma-autoscaling-custom-trigger-memory.adoc[leveloffset=+1]
2833
include::modules/nodes-cma-autoscaling-custom-trigger-kafka.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)