-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
19 changed files
with
1,061 additions
and
9 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
Submodule ansible
updated
12 files
Submodule compute
updated
12 files
Submodule terraform
updated
from 97b841 to cf4451
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"result": { | ||
"covered_percent": 80.37 | ||
"covered_percent": 80.43 | ||
} | ||
} |
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
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,149 @@ | ||
# Copyright 2017 Google Inc. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
- !ruby/object:Api::Type::Integer | ||
name: 'id' | ||
description: 'Unique identifier for the resource.' | ||
output: true | ||
- !ruby/object:Api::Type::Time | ||
name: 'creationTimestamp' | ||
description: 'Creation timestamp in RFC3339 text format.' | ||
output: true | ||
- !ruby/object:Api::Type::String | ||
name: 'name' | ||
description: | | ||
Name of the resource. The name must be 1-63 characters long and match | ||
the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the | ||
first character must be a lowercase letter, and all following | ||
characters must be a dash, lowercase letter, or digit, except the last | ||
character, which cannot be a dash. | ||
required: true | ||
input: true | ||
- !ruby/object:Api::Type::String | ||
name: 'description' | ||
description: | | ||
An optional description of this resource. | ||
- !ruby/object:Api::Type::NestedObject | ||
name: 'autoscalingPolicy' | ||
description: | | ||
The configuration parameters for the autoscaling algorithm. You can | ||
define one or more of the policies for an autoscaler: cpuUtilization, | ||
customMetricUtilizations, and loadBalancingUtilization. | ||
If none of these are specified, the default will be to autoscale based | ||
on cpuUtilization to 0.6 or 60%. | ||
required: true | ||
properties: | ||
- !ruby/object:Api::Type::Integer | ||
name: 'minNumReplicas' | ||
description: | | ||
The minimum number of replicas that the autoscaler can scale down | ||
to. This cannot be less than 0. If not provided, autoscaler will | ||
choose a default value depending on maximum number of instances | ||
allowed. | ||
- !ruby/object:Api::Type::Integer | ||
name: 'maxNumReplicas' | ||
description: | | ||
The maximum number of instances that the autoscaler can scale up | ||
to. This is required when creating or updating an autoscaler. The | ||
maximum number of replicas should not be lower than minimal number | ||
of replicas. | ||
required: true | ||
- !ruby/object:Api::Type::Integer | ||
name: 'coolDownPeriodSec' | ||
description: | | ||
The number of seconds that the autoscaler should wait before it | ||
starts collecting information from a new instance. This prevents | ||
the autoscaler from collecting information when the instance is | ||
initializing, during which the collected usage would not be | ||
reliable. The default time autoscaler waits is 60 seconds. | ||
Virtual machine initialization times might vary because of | ||
numerous factors. We recommend that you test how long an | ||
instance may take to initialize. To do this, create an instance | ||
and time the startup process. | ||
default_value: 60 | ||
- !ruby/object:Api::Type::NestedObject | ||
name: 'cpuUtilization' | ||
description: | | ||
Defines the CPU utilization policy that allows the autoscaler to | ||
scale based on the average CPU utilization of a managed instance | ||
group. | ||
properties: | ||
- !ruby/object:Api::Type::Double | ||
name: 'utilizationTarget' | ||
description: | | ||
The target CPU utilization that the autoscaler should maintain. | ||
Must be a float value in the range (0, 1]. If not specified, the | ||
default is 0.6. | ||
If the CPU level is below the target utilization, the autoscaler | ||
scales down the number of instances until it reaches the minimum | ||
number of instances you specified or until the average CPU of | ||
your instances reaches the target utilization. | ||
If the average CPU is above the target utilization, the autoscaler | ||
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::Array | ||
name: 'customMetricUtilizations' | ||
description: | | ||
Defines the CPU utilization policy that allows the autoscaler to | ||
scale based on the average CPU utilization of a managed instance | ||
group. | ||
item_type: !ruby/object:Api::Type::NestedObject | ||
properties: | ||
- !ruby/object:Api::Type::String | ||
name: 'metric' | ||
description: | | ||
The identifier (type) of the Stackdriver Monitoring metric. | ||
The metric cannot have negative values. | ||
The metric must have a value type of INT64 or DOUBLE. | ||
required: true | ||
- !ruby/object:Api::Type::Double | ||
name: 'utilizationTarget' | ||
description: | | ||
The target value of the metric that autoscaler should | ||
maintain. This must be a positive value. A utilization | ||
metric scales number of virtual machines handling requests | ||
to increase or decrease proportionally to the metric. | ||
For example, a good metric to use as a utilizationTarget is | ||
www.googleapis.com/compute/instance/network/received_bytes_count. | ||
The autoscaler will work to keep this value constant for each | ||
of the instances. | ||
required: true | ||
- !ruby/object:Api::Type::Enum | ||
name: 'utilizationTargetType' | ||
description: | | ||
Defines how target utilization value is expressed for a | ||
Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, | ||
or DELTA_PER_MINUTE. | ||
values: | ||
- :GAUGE | ||
- :DELTA_PER_SECOND | ||
- :DELTA_PER_MINUTE | ||
required: true | ||
- !ruby/object:Api::Type::NestedObject | ||
name: 'loadBalancingUtilization' | ||
description: | | ||
Configuration parameters of autoscaling based on a load balancer. | ||
properties: | ||
- !ruby/object:Api::Type::Double | ||
name: 'utilizationTarget' | ||
description: | | ||
Fraction of backend capacity utilization (set in HTTP(s) load | ||
balancing configuration) that autoscaler should maintain. Must | ||
be a positive float value. If not defined, the default is 0.8. |
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
48 changes: 48 additions & 0 deletions
48
products/compute/helpers/terraform/autoscaler_overrides.yaml
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,48 @@ | ||
# Copyright 2017 Google Inc. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
id: !ruby/object:Provider::Terraform::PropertyOverride | ||
exclude: true | ||
name: !ruby/object:Provider::Terraform::PropertyOverride | ||
validation: !ruby/object:Provider::Terraform::Validation | ||
function: 'validateGCPName' | ||
autoscalingPolicy.minNumReplicas: !ruby/object:Provider::Terraform::PropertyOverride | ||
name: minReplicas | ||
# Even though this field isn't actually required by the API, it makes our | ||
# lives easier if we treat it as a required field. It has a default that is | ||
# set by the API based on the value of maxNumReplicas. Normally in this case | ||
# we would just set it to Optional+Computed. However, this currently doesn't | ||
# work with nested fields. Make it required so we don't set the field to zero | ||
# when our users aren't expecting us to. For more info, see | ||
# https://github.com/GoogleCloudPlatform/magic-modules/issues/305. | ||
required: true | ||
autoscalingPolicy.maxNumReplicas: !ruby/object:Provider::Terraform::PropertyOverride | ||
name: maxReplicas | ||
autoscalingPolicy.coolDownPeriodSec: !ruby/object:Provider::Terraform::PropertyOverride | ||
name: cooldownPeriod | ||
autoscalingPolicy.cpuUtilization: !ruby/object:Provider::Terraform::PropertyOverride | ||
default_from_api: true | ||
autoscalingPolicy.cpuUtilization.utilizationTarget: !ruby/object:Provider::Terraform::PropertyOverride | ||
name: target | ||
required: true # See comment for minReplicas | ||
autoscalingPolicy.customMetricUtilizations: !ruby/object:Provider::Terraform::PropertyOverride | ||
name: metric | ||
autoscalingPolicy.customMetricUtilizations.metric: !ruby/object:Provider::Terraform::PropertyOverride | ||
name: name | ||
autoscalingPolicy.customMetricUtilizations.utilizationTarget: !ruby/object:Provider::Terraform::PropertyOverride | ||
name: target | ||
autoscalingPolicy.customMetricUtilizations.utilizationTargetType: !ruby/object:Provider::Terraform::PropertyOverride | ||
name: type | ||
autoscalingPolicy.loadBalancingUtilization.utilizationTarget: !ruby/object:Provider::Terraform::PropertyOverride | ||
name: target | ||
required: true # See comment for minReplicas |
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
Oops, something went wrong.