forked from kedacore/keda
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add cpu/memory scaler (kedacore#277)
Signed-off-by: silenceper <[email protected]>
- Loading branch information
1 parent
81f59ef
commit 55b061e
Showing
3 changed files
with
100 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
+++ | ||
title = "CPU" | ||
layout = "scaler" | ||
availability = "v2.0+" | ||
maintainer = "Community" | ||
description = "Scale applications based on cpu metrics." | ||
go_file = "cpu_memory_scaler" | ||
+++ | ||
|
||
> **Notice:** | ||
> - This scaler will never scale to 0 and even when user define multiple scaler types (eg. Kafka + cpu/memory, or Prometheus + cpu/memory), the deployment will never scale to 0 | ||
> - This scaler only applies to ScaledObject, not to Scaling Jobs. | ||
### Trigger Specification | ||
|
||
This specification describes the `cpu` trigger that scales based on cpu metrics. | ||
|
||
```yaml | ||
triggers: | ||
- type: cpu | ||
metadata: | ||
# Required | ||
type: Value/ Utilization/ AverageValue | ||
value: 60 | ||
``` | ||
**Parameter list:** | ||
- `type ` represents whether the metric type is Utilization, Value, or AverageValue. Required. | ||
- `value ` this value depends on the type setting | ||
- if `type` set to `Value` this value is target value of the metric (as a quantity) | ||
- if `type` set to `Utilization ` this value is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. | ||
- if `type` set to `AverageValue` this value is the target value of the average of the metric across all relevant pods (quantity). | ||
|
||
### Example | ||
|
||
```yaml | ||
apiVersion: keda.sh/v1alpha1 | ||
kind: ScaledObject | ||
metadata: | ||
name: cpu-scaledobject | ||
namespace: default | ||
spec: | ||
scaleTargetRef: | ||
name: my-deployment | ||
triggers: | ||
- type: cpu | ||
metadata: | ||
type: Utilization | ||
value: "50" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
+++ | ||
title = "Memory" | ||
layout = "scaler" | ||
availability = "v2.0+" | ||
maintainer = "Community" | ||
description = "Scale applications based on memory metrics." | ||
go_file = "cpu_memory_scaler" | ||
+++ | ||
> **Notice:** | ||
> - This scaler will never scale to 0 and even when user define multiple scaler types (eg. Kafka + cpu/memory, or Prometheus + cpu/memory), the deployment will never scale to 0 | ||
> - This scaler only applies to ScaledObject, not to Scaling Jobs. | ||
### Trigger Specification | ||
|
||
This specification describes the `memory` trigger that scales based on memory metrics. | ||
|
||
```yaml | ||
triggers: | ||
- type: memory | ||
metadata: | ||
# Required | ||
type: Value/ Utilization/ AverageValue | ||
value: 60 | ||
``` | ||
**Parameter list:** | ||
- `type ` represents whether the metric type is Utilization, Value, or AverageValue. Required. | ||
- `value ` this value depends on the type setting | ||
- if `type` set to `Value` this value is target value of the metric (as a quantity) | ||
- if `type` set to `Utilization ` this value is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. | ||
- if `type` set to `AverageValue` this value is the target value of the average of the metric across all relevant pods (quantity). | ||
|
||
### Example | ||
|
||
```yaml | ||
apiVersion: keda.sh/v1alpha1 | ||
kind: ScaledObject | ||
metadata: | ||
name: memory-scaledobject | ||
namespace: default | ||
spec: | ||
scaleTargetRef: | ||
name: my-deployment | ||
triggers: | ||
- type: memory | ||
metadata: | ||
type: Utilization | ||
value: "50" | ||
``` |