Skip to content

Commit

Permalink
Add Node group maintenance policy (#4097)
Browse files Browse the repository at this point in the history
  • Loading branch information
upodroid authored Oct 13, 2020
1 parent f703f86 commit 50eede4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 5 additions & 1 deletion products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7951,9 +7951,13 @@ objects:
The total number of nodes in the node group.
required: true
send_empty_value: true
- !ruby/object:Api::Type::String
name: 'maintenancePolicy'
description: |
Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT.
default_value: DEFAULT
- !ruby/object:Api::Type::NestedObject
name: 'autoscalingPolicy'
min_version: beta
description: |
If you use sole-tenant nodes for your workloads, you can use the node
group autoscaler to automatically manage the sizes of your node groups.
Expand Down
1 change: 0 additions & 1 deletion products/compute/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
template_name: "soletenant-tmpl"
- !ruby/object:Provider::Terraform::Examples
name: "node_group_autoscaling_policy"
min_version: beta
primary_resource_id: "nodes"
vars:
group_name: "soletenant-group"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
resource "google_compute_node_template" "soletenant-tmpl" {
provider = google-beta
name = "<%= ctx[:vars]['template_name'] %>"
region = "us-central1"
node_type = "n1-node-96-624"
}

resource "google_compute_node_group" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta
name = "<%= ctx[:vars]['group_name'] %>"
zone = "us-central1-a"
description = "example google_compute_node_group for Terraform Google Provider"

maintenance_policy = "RESTART_IN_PLACE"
size = 1
node_template = google_compute_node_template.soletenant-tmpl.id
autoscaling_policy {
mode = "ON"
mode = "ONLY_SCALE_OUT"
min_nodes = 1
max_nodes = 10
}
Expand Down

0 comments on commit 50eede4

Please sign in to comment.