Skip to content

Commit

Permalink
option to restore to original replica count after ScaledObject's dele…
Browse files Browse the repository at this point in the history
…tion (#219)

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
  • Loading branch information
zroubalik authored Aug 10, 2020
1 parent be8625a commit b80c1c6
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions content/docs/2.0/concepts/scaling-deployments.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ spec:
cooldownPeriod: 300 # Optional. Default: 300 seconds
minReplicaCount: 0 # Optional. Default: 0
maxReplicaCount: 100 # Optional. Default: 100
advanced: # Optional. Section to specify advanced options.
horizontalPodAutoscalerConfig: # Optional. If not set, KEDA won't scale based on resource utilization
resourceMetrics:
advanced: # Optional. Section to specify advanced options
restoreToOriginalReplicaCount: true/false # Optional. Default: false
horizontalPodAutoscalerConfig: # Optional. Section to specify HPA related options
resourceMetrics: # Optional. If not set, KEDA won't scale based on resource utilization
- name: cpu/memory # Name of the metric to scale on
target:
type: value/ utilization/ averagevalue
Expand Down Expand Up @@ -129,15 +130,29 @@ This setting is passed to the HPA definition that KEDA will create for a given r

```yaml
advanced:
horizontalPodAutoscalerConfig:
resourceMetrics:
restoreToOriginalReplicaCount: true/false # Optional. Default: false
```

This property specifies whether the target resource (`Deployment`, `StatefulSet`,...) should be scaled back to original replicas count, after the `ScaledObject` is deleted.
Default behavior is to keep the replica count at the same number as it is in the moment of `ScaledObject's` deletion.

For example a `Deployment` with `3 replicas` is created, then `ScaledObject` is created and the `Deployment` is scaled by KEDA to `10 replicas`. Then `ScaledObject` is deleted:
1. if `restoreToOriginalReplicaCount = false` (default behavior) then `Deployment` replicas count is `10`
2. if `restoreToOriginalReplicaCount = true` then `Deployment` replicas count is set back to `3` (the original value)

---

```yaml
advanced:
horizontalPodAutoscalerConfig: # Optional. Section to specify HPA related options
resourceMetrics: # Optional. If not set, KEDA won't scale based on resource utilization
- name: cpu/memory # Name of the metric to scale on
target:
type: value/ utilization/ averagevalue
value: 60 # Optional
averageValue: 40 # Optional
averageUtilization: 50 # Optional
behavior:
behavior: # Optional. Use to modify HPA's scaling behavior
scaleDown:
stabilizationWindowSeconds: 300
policies:
Expand All @@ -146,7 +161,6 @@ advanced:
periodSeconds: 15
```


**`horizontalPodAutoscalerConfig:`**

This section contains configuration that is the same as some parts of the standard HorizontalPodAutoscaler configuration. KEDA would feed properties from this section into a apropriate places into the HPA configuration. This way one can modify the HPA that is being created and managed by KEDA.
Expand Down

0 comments on commit b80c1c6

Please sign in to comment.