Skip to content

Commit

Permalink
Add support for google_compute_autoscaler autoscalingPolicy.cpuUtiliz…
Browse files Browse the repository at this point in the history
…ation.predictiveMethod (#4523)

Co-authored-by: upodroid <[email protected]>
  • Loading branch information
upodroid authored Feb 24, 2021
1 parent 42a0e39 commit b713fdd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions mmv1/products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,16 @@ objects:
scales up until it reaches the maximum number of instances you
specified or until the average utilization reaches the target
utilization.
- !ruby/object:Api::Type::String
name: 'predictiveMethod'
min_version: beta
default_value: NONE
description: |
Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are:

- NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics.

- OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand.
- !ruby/object:Api::Type::Array
name: 'customMetricUtilizations'
description: |
Expand Down Expand Up @@ -9661,6 +9671,16 @@ objects:
scales up until it reaches the maximum number of instances you
specified or until the average utilization reaches the target
utilization.
- !ruby/object:Api::Type::String
name: 'predictiveMethod'
min_version: beta
default_value: NONE
description: |
Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are:

- NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics.

- OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand.
- !ruby/object:Api::Type::Array
name: 'customMetricUtilizations'
description: |
Expand Down
4 changes: 4 additions & 0 deletions mmv1/products/compute/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ overrides: !ruby/object:Overrides::ResourceOverrides
autoscalingPolicy.cpuUtilization.utilizationTarget: !ruby/object:Overrides::Terraform::PropertyOverride
name: target
required: true # See comment for minReplicas
autoscalingPolicy.cpuUtilization.predictiveMethod: !ruby/object:Overrides::Terraform::PropertyOverride
custom_flatten: 'templates/terraform/custom_flatten/default_if_empty.erb'
autoscalingPolicy.customMetricUtilizations: !ruby/object:Overrides::Terraform::PropertyOverride
name: metric
autoscalingPolicy.customMetricUtilizations.metric: !ruby/object:Overrides::Terraform::PropertyOverride
Expand Down Expand Up @@ -1693,6 +1695,8 @@ overrides: !ruby/object:Overrides::ResourceOverrides
autoscalingPolicy.cpuUtilization.utilizationTarget: !ruby/object:Overrides::Terraform::PropertyOverride
name: target
required: true # See comment for minReplicas
autoscalingPolicy.cpuUtilization.predictiveMethod: !ruby/object:Overrides::Terraform::PropertyOverride
custom_flatten: 'templates/terraform/custom_flatten/default_if_empty.erb'
autoscalingPolicy.customMetricUtilizations: !ruby/object:Overrides::Terraform::PropertyOverride
name: metric
autoscalingPolicy.customMetricUtilizations.metric: !ruby/object:Overrides::Terraform::PropertyOverride
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ resource "google_compute_autoscaler" "foobar" {
cooldown_period = 60
cpu_utilization {
target = 0.5
predictive_method = "OPTIMIZE_AVAILABILITY"
}
scale_down_control {
max_scaled_down_replicas {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ resource "google_compute_region_autoscaler" "foobar" {
cooldown_period = 60
cpu_utilization {
target = 0.5
predictive_method = "OPTIMIZE_AVAILABILITY"
}
scale_down_control {
max_scaled_down_replicas {
Expand Down

0 comments on commit b713fdd

Please sign in to comment.