Skip to content
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

Add mode enum and scale down controls for Compute AutoScaler #3693

Merged
merged 4 commits into from
Jun 23, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 38 additions & 5 deletions products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,39 @@ objects:
instance may take to initialize. To do this, create an instance
and time the startup process.
default_value: 60
- !ruby/object:Api::Type::Enum
name: 'mode'
description: |
Defines operating mode for this policy.
values:
- :OFF
- :ONLY_UP
- :ON
- !ruby/object:Api::Type::NestedObject
name: 'scaleDownControl'
min_version: beta
description: |
Defines scale down controls to reduce the risk of response latency
and outages due to abrupt scale-in events
properties:
- !ruby/object:Api::Type::NestedObject
name: 'maxScaledDownReplicas'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add at_least_one_of: for this?

It helps us prevent issues around empty blocks by requiring at least one field per block is specified.

In this case I believe it will look like:

at_least_one_of:
  - scale_down_control.0.max_scaled_down_replicas.0.fixed
  - scale_down_control.0.max_scaled_down_replicas.0.percent

And then one to scaleDownControl that looks like:

at_least_one_of:
  - scale_down_control.0.max_scaled_down_replicas
  - scale_down_control.0.time_window_sec

For example: https://github.com/GoogleCloudPlatform/magic-modules/blob/master/products/compute/api.yaml#L757

properties:
- !ruby/object:Api::Type::Integer
name: 'fixed'
description: |
Specifies a fixed number of VM instances. This must be a positive
integer.
- !ruby/object:Api::Type::Integer
name: 'percent'
description: |
Specifies a percentage of instances between 0 to 100%, inclusive.
For example, specify 80 for 80%.
- !ruby/object:Api::Type::Integer
name: 'timeWindowSec'
description: |
How long back autoscaling should look when computing recommendations
to include directives regarding slower scale down, as described above.
- !ruby/object:Api::Type::NestedObject
name: 'cpuUtilization'
description: |
Expand Down Expand Up @@ -7590,8 +7623,8 @@ objects:
The autoscaling mode. Set to one of the following:
- OFF: Disables the autoscaler.
- ON: Enables scaling in and scaling out.
- ONLY_SCALE_OUT: Enables only scaling out.
You must use this mode if your node groups are configured to
- ONLY_SCALE_OUT: Enables only scaling out.
You must use this mode if your node groups are configured to
restart their hosted VMs on minimal servers.
values:
- :OFF
Expand All @@ -7600,7 +7633,7 @@ objects:
- !ruby/object:Api::Type::Integer
name: 'minNodes'
description: |
Minimum size of the node group. Must be less
Minimum size of the node group. Must be less
than or equal to max-nodes. The default value is 0.
- !ruby/object:Api::Type::Integer
name: 'maxNodes'
Expand Down Expand Up @@ -7846,7 +7879,7 @@ objects:
description: The name of the packet mirroring rule
required: true
- !ruby/object:Api::Type::String
name: description
name: description
description: A human-readable description of the rule.
input: true
- !ruby/object:Api::Type::String
Expand Down Expand Up @@ -7890,7 +7923,7 @@ objects:
imports: 'selfLink'
description: The URL of the forwarding rule.
- !ruby/object:Api::Type::NestedObject
name: filter
name: filter
description: |
A filter for mirrored traffic. If unset, all traffic is mirrored.
properties:
Expand Down