You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<8> Optional: Specifies the maximum number of replicas when scaling up. The default is `100`.
140
141
<9> Optional: Specifies the minimum number of replicas when scaling down.
141
142
<10> Optional: Specifies the parameters for audit logs. as described in the "Configuring audit logging" section.
142
-
<11> Optional: Specifies the number of replicas to fall back to if a scaler fails to get metrics from the source for the number of times defined by the `failureThreshold` parameter. For more information on fallback behavior, see the link:https://keda.sh/docs/2.7/concepts/scaling-deployments/#fallback[KEDA documentation].
143
-
<12> Optional: Specifies the interval in seconds to check each trigger on. The default is `30`.
144
-
<13> Optional: Specifies whether to scale back the target resource to the original replica count after the scaled object is deleted. The default is `false`, which keeps the replica count as it is when the scaled object is deleted.
145
-
<14> Optional: Specifies a name for the horizontal pod autoscaler. The default is `keda-hpa-{scaled-object-name}`.
146
-
<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.
147
-
<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.
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.
143
+
<11> Optional: Specifies the number of replicas to fall back to if a scaler fails to get metrics from the source for the number of times defined by the `failureThreshold` parameter. For more information on fallback behavior, see the link:https://keda.sh/docs/latest/reference/scaledobject-spec/#fallback[KEDA documentation].
144
+
<12> Optional: Specifies the replica count to be used if a fallback occurs. Enter one of the following options or omit the parameter:
145
+
* Enter `static` to use the number of replicas specified by the `fallback.replicas` parameter. This is the default.
146
+
* Enter `currentReplicas` to maintain the current number of replicas.
147
+
* Enter `currentReplicasIfHigher` to maintain the current number of replicas, if that number is higher than the `fallback.replicas` parameter. If the current number of replicas is lower than the `fallback.replicas` parameter, use the `fallback.replicas` value.
148
+
* Enter `currentReplicasIfLower` to maintain the current number of replicas, if that number is lower than the `fallback.replicas` parameter. If the current number of replicas is higher than the `fallback.replicas` parameter, use the `fallback.replicas` value.
149
+
<13> Optional: Specifies the interval in seconds to check each trigger on. The default is `30`.
150
+
<14> Optional: Specifies whether to scale back the target resource to the original replica count after the scaled object is deleted. The default is `false`, which keeps the replica count as it is when the scaled object is deleted.
151
+
<15> Optional: Specifies a name for the horizontal pod autoscaler. The default is `keda-hpa-{scaled-object-name}`.
152
+
<16> Optional: Specifies a scaling policy to use to control the rate to scale pods up or down, as described in the "Scaling policies" section.
153
+
<17> 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.
154
+
<18> 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
155
* Enter `TriggerAuthentication` to use a trigger authentication. This is the default.
150
156
* Enter `ClusterTriggerAuthentication` to use a cluster trigger authentication.
Copy file name to clipboardExpand all lines: modules/nodes-cma-autoscaling-custom-trigger-auth-using.adoc
+44-18Lines changed: 44 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,43 +12,69 @@ You use trigger authentications and cluster trigger authentications by using a c
12
12
13
13
* The Custom Metrics Autoscaler Operator must be installed.
14
14
15
-
* If you are using a secret, the `Secret` object must exist, for example:
15
+
* If you are using a bound service account token, the service account must exist.
16
+
17
+
* If you are using a bound service account token, a role-based access control (RBAC) object that enables the Custom Metrics Autoscaler Operator to request service account tokens from the service account must exist.
16
18
+
17
-
.Example secret
18
19
[source,yaml]
19
20
----
20
-
apiVersion: v1
21
-
kind: Secret
21
+
apiVersion: rbac.authorization.k8s.io/v1
22
+
kind: Role
23
+
metadata:
24
+
name: keda-operator-token-creator
25
+
namespace: <namespace_name> <1>
26
+
rules:
27
+
- apiGroups:
28
+
- ""
29
+
resources:
30
+
- serviceaccounts/token
31
+
verbs:
32
+
- create
33
+
resourceNames:
34
+
- thanos <2>
35
+
---
36
+
apiVersion: rbac.authorization.k8s.io/v1
37
+
kind: RoleBinding
22
38
metadata:
23
-
name: my-secret
24
-
data:
25
-
user-name: <base64_USER_NAME>
26
-
password: <base64_USER_PASSWORD>
39
+
name: keda-operator-token-creator-binding
40
+
namespace: <namespace_name> <3>
41
+
roleRef:
42
+
apiGroup: rbac.authorization.k8s.io
43
+
kind: Role
44
+
name: keda-operator-token-creator
45
+
subjects:
46
+
- kind: ServiceAccount
47
+
name: keda-operator
48
+
namespace: openshift-keda
27
49
----
50
+
<1> Specifies the namespace of the service account.
51
+
<2> Specifies the name of the service account.
52
+
<3> Specifies the namespace of the service account.
53
+
54
+
* If you are using a secret, the `Secret` object must exist.
28
55
29
56
.Procedure
30
57
31
58
. Create the `TriggerAuthentication` or `ClusterTriggerAuthentication` object.
32
59
33
60
.. Create a YAML file that defines the object:
34
61
+
35
-
.Example trigger authentication with a secret
62
+
.Example trigger authentication with a bound service account token
36
63
[source,yaml]
37
64
----
38
65
kind: TriggerAuthentication
39
66
apiVersion: keda.sh/v1alpha1
40
67
metadata:
41
68
name: prom-triggerauthentication
42
-
namespace: my-namespace
43
-
spec:
44
-
secretTargetRef:
45
-
- parameter: user-name
46
-
name: my-secret
47
-
key: USER_NAME
48
-
- parameter: password
49
-
name: my-secret
50
-
key: USER_PASSWORD
69
+
namespace: my-namespace <1>
70
+
spec:
71
+
boundServiceAccountToken: <2>
72
+
- parameter: token
73
+
serviceAccountName: thanos <3>
51
74
----
75
+
<1> Specifies the namespace of the object you want to scale.
76
+
<2> Specifies that this trigger authentication uses a bound service account token for authorization when connecting to the metrics endpoint.
77
+
<3> Specifies the name of the service account to use.
Copy file name to clipboardExpand all lines: modules/nodes-cma-autoscaling-custom-trigger-prom.adoc
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,7 @@ spec:
35
35
cortexOrgID: my-org <8>
36
36
ignoreNullValues: "false" <9>
37
37
unsafeSsl: "false" <10>
38
+
timeout: 1000 <11>
38
39
----
39
40
<1> Specifies Prometheus as the trigger type.
40
41
<2> Specifies the address of the Prometheus server. This example uses {product-title} monitoring.
@@ -51,7 +52,10 @@ spec:
51
52
* If `false`, the certificate check is performed. This is the default behavior.
52
53
* If `true`, the certificate check is not performed.
53
54
+
55
+
--
54
56
[IMPORTANT]
55
57
====
56
58
Skipping the check is not recommended.
57
59
====
60
+
--
61
+
<11> Optional: Specifies an HTTP request timeout in milliseconds for the HTTP client used by this Prometheus trigger. This value overrides any global timeout setting.
0 commit comments