Skip to content

Commit

Permalink
[datadogpodautoscalers] Add stabilization window to scaling policy (#…
Browse files Browse the repository at this point in the history
…1519)

* Add stabilization window to scaling policy autoscaling CRD

* fixup! Add stabilization window to scaling policy autoscaling CRD

* Reorder fields alphabetically

* Add validation for stabilization window

* Generate DPA CRD files

* fixup! Generate DPA CRD files

* Remove default setting of stabilization window seconds to 0

* Update minimum stabilization window seconds to 0

* fixup! Update minimum stabilization window seconds to 0

---------

Co-authored-by: levan-m <116471169+levan-m@users.noreply.github.com>
  • Loading branch information
jennchenn and levan-m authored Dec 19, 2024
1 parent c17ec1d commit 459d28e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/datadoghq/v1alpha1/datadogpodautoscaler_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ type DatadogPodAutoscalerScalingPolicy struct {
// +listType=atomic
// +optional
Rules []DatadogPodAutoscalerScalingRule `json:"rules,omitempty"`

// StabilizationWindowSeconds is the number of seconds the controller should lookback at previous recommendations
// before deciding to apply a new one. Defaults to 0.
// +optional
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=1800
StabilizationWindowSeconds int32 `json:"stabilizationWindowSeconds,omitempty"`
}

// DatadogPodAutoscalerScalingRuleType defines how scaling rule value should be interpreted.
Expand Down
16 changes: 16 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogpodautoscalers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,14 @@ spec:
type: object
type: array
x-kubernetes-list-type: atomic
stabilizationWindowSeconds:
description: |-
StabilizationWindowSeconds is the number of seconds the controller should lookback at previous recommendations
before deciding to apply a new one. Defaults to 0.
format: int32
maximum: 1800
minimum: 0
type: integer
strategy:
description: |-
Strategy is used to specify which policy should be used.
Expand Down Expand Up @@ -291,6 +299,14 @@ spec:
type: object
type: array
x-kubernetes-list-type: atomic
stabilizationWindowSeconds:
description: |-
StabilizationWindowSeconds is the number of seconds the controller should lookback at previous recommendations
before deciding to apply a new one. Defaults to 0.
format: int32
maximum: 1800
minimum: 0
type: integer
strategy:
description: |-
Strategy is used to specify which policy should be used.
Expand Down
10 changes: 10 additions & 0 deletions config/crd/bases/v1beta1/datadoghq.com_datadogpodautoscalers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ spec:
type: object
type: array
x-kubernetes-list-type: atomic
stabilizationWindowSeconds:
description: StabilizationWindowSeconds is used to specify the number of seconds to lookback to stabilize new recommendations before deciding to apply a new one. Defaults to 0.
format: int32
minimum: 0
type: integer
strategy:
description: Strategy is used to specify which policy should be used. If not set, the default value Max is used.
enum:
Expand Down Expand Up @@ -256,6 +261,11 @@ spec:
type: object
type: array
x-kubernetes-list-type: atomic
stabilizationWindowSeconds:
description: StabilizationWindowSeconds is used to specify the number of seconds to lookback to stabilize new recommendations. Defaults to 0.
format: int32
minimum: 0
type: integer
strategy:
description: Strategy is used to specify which policy should be used. If not set, the default value Max is used.
enum:
Expand Down

0 comments on commit 459d28e

Please sign in to comment.