-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[enterprise-4.18] Custom Metrics Autoscaler compilation PR #99357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Module included in the following assemblies: | ||
// | ||
// * nodes/cma/nodes-cma-autoscaling-custom-trigger.adoc | ||
|
||
:_mod-docs-content-type: PROCEDURE | ||
[id="nodes-cma-autoscaling-custom-trigger-workload_{context}"] | ||
= Understanding the Kubernetes workload trigger | ||
|
||
You can scale pods based on the number of pods matching a specific label selector. | ||
|
||
The Custom Metrics Autoscaler Operator tracks the number of pods with a specific label that are in the same namespace, then calculates a _relation_ based on the number of labeled pods to the pods for the scaled object. Using this relation, the Custom Metrics Autoscaler Operator scales the object according to the scaling policy in the `ScaledObject` or `ScaledJob` specification. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 [error] Vale.Terms: Use '(?<!.*-)operator' instead of 'Operator'. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 [error] Vale.Terms: Use '(?<!.*-)operator' instead of 'Operator'. |
||
|
||
The pod counts includes pods with a `Succeeded` or `Failed` phase. | ||
|
||
For example, if you have a `frontend` deployment and a `backend` deployment. You can use a `kubernetes-workload` trigger to scale the `backend` deployment based on the number of `frontend` pods. If number of `frontend` pods goes up, the Operator would scale the `backend` pods to maintain the specified ratio. In this example, if there are 10 pods with the `app=frontend` pod selector, the Operator scales the backend pods to 5 in order to maintain the `0.5` ratio set in the scaled object. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 [error] Vale.Terms: Use '(?<!.*-)operator' instead of 'Operator'. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 [error] Vale.Terms: Use '(?<!.*-)operator' instead of 'Operator'. |
||
|
||
.Example scaled object with a Kubernetes workload trigger | ||
[source,yaml] | ||
---- | ||
apiVersion: keda.sh/v1alpha1 | ||
kind: ScaledObject | ||
metadata: | ||
name: workload-scaledobject | ||
namespace: my-namespace | ||
spec: | ||
triggers: | ||
- type: kubernetes-workload <1> | ||
metadata: | ||
podSelector: 'app=frontend' <2> | ||
value: '0.5' <3> | ||
activationValue: '3.1' <4> | ||
---- | ||
<1> Specifies a Kubernetes workload trigger. | ||
<2> Specifies one or more pod selectors and/or set-based selectors, separated with commas, to use to get the pod count. | ||
<3> Specifies the target relation between the scaled workload and the number of pods that match the selector. The relation is calculated following the following formula: | ||
+ | ||
---- | ||
relation = (pods that match the selector) / (scaled workload pods) | ||
---- | ||
+ | ||
<4> Optional: Specifies the target value for scaler activation phase. The default is `0`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 [error] Vale.Terms: Use '(?<!.*-)operator' instead of 'Operator'.