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 autoscaling to DPMS terraform #10522

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
47 changes: 47 additions & 0 deletions mmv1/products/metastore/Service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,26 @@ examples:
primary_resource_id: 'backup'
vars:
metastore_service_name: 'backup'
- !ruby/object:Provider::Terraform::Examples
name: 'dataproc_metastore_service_autoscaling_max_scaling_factor'
primary_resource_id: 'test_resource'
vars:
metastore_service_name: 'test-service'
- !ruby/object:Provider::Terraform::Examples
name: 'dataproc_metastore_service_autoscaling_min_and_max_scaling_factor'
primary_resource_id: 'test_resource'
vars:
metastore_service_name: 'test-service'
- !ruby/object:Provider::Terraform::Examples
name: 'dataproc_metastore_service_autoscaling_min_scaling_factor'
primary_resource_id: 'test_resource'
vars:
metastore_service_name: 'test-service'
- !ruby/object:Provider::Terraform::Examples
name: 'dataproc_metastore_service_autoscaling_no_limit_config'
primary_resource_id: 'test_resource'
vars:
metastore_service_name: 'test-service'
parameters:
- !ruby/object:Api::Type::String
name: 'serviceId'
Expand Down Expand Up @@ -228,6 +248,7 @@ properties:
exactly_one_of:
- scaling_config.0.instance_size
- scaling_config.0.scaling_factor
- scaling_config.0.autoscaling_config
conflicts:
- tier
values:
Expand All @@ -241,6 +262,32 @@ properties:
description: |
Scaling factor, in increments of 0.1 for values less than 1.0, and increments of 1.0 for values greater than 1.0.
required: false
- !ruby/object:Api::Type::NestedObject
name: 'autoscalingConfig'
min_version: beta
description: |
Represents the autoscaling configuration of a metastore service.
required: false
properties:
- !ruby/object:Api::Type::Boolean
name: 'autoscalingEnabled'
description: |
Defines whether autoscaling is enabled. The default value is false.
brandon-m-hansen marked this conversation as resolved.
Show resolved Hide resolved
- !ruby/object:Api::Type::NestedObject
name: 'limitConfig'
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 a default_from_api to this nested object too?

description: |
Represents the limit configuration of a metastore service.
properties:
- !ruby/object:Api::Type::Double
name: 'minScalingFactor'
description: |
The minimum scaling factor that the service will autoscale to. The default value is 0.1.
default_from_api: true
- !ruby/object:Api::Type::Double
name: 'maxScalingFactor'
description: |
The maximum scaling factor that the service will autoscale to. The default value is 6.0.
default_from_api: true
- !ruby/object:Api::Type::NestedObject
name: 'scheduledBackup'
description: |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "google_dataproc_metastore_service" "<%= ctx[:primary_resource_id] %>" {
service_id = "<%= ctx[:vars]['metastore_service_name'] %>"
location = "us-central1"

# DPMS 2 requires SPANNER database type, and does not require
# a maintenance window.
database_type = "SPANNER"

hive_metastore_config {
version = "3.1.2"
}

scaling_config {
autoscaling_config {
autoscaling_enabled = true
limit_config {
max_scaling_factor = 1.0
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
resource "google_dataproc_metastore_service" "<%= ctx[:primary_resource_id] %>" {
service_id = "<%= ctx[:vars]['metastore_service_name'] %>"
location = "us-central1"

# DPMS 2 requires SPANNER database type, and does not require
# a maintenance window.
database_type = "SPANNER"

hive_metastore_config {
version = "3.1.2"
}

scaling_config {
autoscaling_config {
autoscaling_enabled = true
limit_config {
min_scaling_factor = 0.1
max_scaling_factor = 1.0
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "google_dataproc_metastore_service" "<%= ctx[:primary_resource_id] %>" {
service_id = "<%= ctx[:vars]['metastore_service_name'] %>"
location = "us-central1"

# DPMS 2 requires SPANNER database type, and does not require
# a maintenance window.
database_type = "SPANNER"

hive_metastore_config {
version = "3.1.2"
}

scaling_config {
autoscaling_config {
autoscaling_enabled = true
limit_config {
min_scaling_factor = 0.1
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resource "google_dataproc_metastore_service" "<%= ctx[:primary_resource_id] %>" {
service_id = "<%= ctx[:vars]['metastore_service_name'] %>"
location = "us-central1"

# DPMS 2 requires SPANNER database type, and does not require
# a maintenance window.
database_type = "SPANNER"

hive_metastore_config {
version = "3.1.2"
}

scaling_config {
autoscaling_config {
autoscaling_enabled = true
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "google_dataproc_metastore_service" "{{$.PrimaryResourceId}}" {
service_id = "{{index $.Vars "metastore_service_name"}}"
location = "us-central1"

# DPMS 2 requires SPANNER database type, and does not require
# a maintenance window.
database_type = "SPANNER"

hive_metastore_config {
version = "3.1.2"
}

scaling_config {
autoscaling_config {
autoscaling_enabled = true
limit_config {
max_scaling_factor = 1.0
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
resource "google_dataproc_metastore_service" "{{$.PrimaryResourceId}}" {
service_id = "{{index $.Vars "metastore_service_name"}}"
location = "us-central1"

# DPMS 2 requires SPANNER database type, and does not require
# a maintenance window.
database_type = "SPANNER"

hive_metastore_config {
version = "3.1.2"
}

scaling_config {
autoscaling_config {
autoscaling_enabled = true
limit_config {
min_scaling_factor = 0.1
max_scaling_factor = 1.0
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "google_dataproc_metastore_service" "{{$.PrimaryResourceId}}" {
service_id = "{{index $.Vars "metastore_service_name"}}"
location = "us-central1"

# DPMS 2 requires SPANNER database type, and does not require
# a maintenance window.
database_type = "SPANNER"

hive_metastore_config {
version = "3.1.2"
}

scaling_config {
autoscaling_config {
autoscaling_enabled = true
limit_config {
min_scaling_factor = 0.1
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resource "google_dataproc_metastore_service" "{{$.PrimaryResourceId}}" {
service_id = "{{index $.Vars "metastore_service_name"}}"
location = "us-central1"

# DPMS 2 requires SPANNER database type, and does not require
# a maintenance window.
database_type = "SPANNER"

hive_metastore_config {
version = "3.1.2"
}

scaling_config {
autoscaling_config {
autoscaling_enabled = true
}
}
}