Skip to content

Commit

Permalink
[CES-576] Remove autoscaler for Wallet release gate (#1353)
Browse files Browse the repository at this point in the history
Co-authored-by: Krusty93 <andera.grillo@pagopa.it>
  • Loading branch information
Krusty93 and Krusty93 authored Dec 9, 2024
1 parent 0eb5706 commit 68b2531
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 441 deletions.
13 changes: 0 additions & 13 deletions src/_modules/common_values/outputs_configurable.tf

This file was deleted.

4 changes: 2 additions & 2 deletions src/common/prod/westeurope.tf
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ module "application_gateway_weu" {
}

cidr_subnet = ["10.0.13.0/24"]
min_capacity = 20 # 4 capacity=baseline, 10 capacity=high volume event, 15 capacity=very high volume event
max_capacity = 100
min_capacity = 10 # 4 capacity=baseline, 10 capacity=high volume event, 15 capacity=very high volume event
max_capacity = 80
alerts_enabled = true
deny_paths = ["\\/admin\\/(.*)"]
error_action_group_id = module.monitoring_weu.action_groups.error
Expand Down
104 changes: 0 additions & 104 deletions src/domains/citizen-auth-app/04_function_lollipop.tf
Original file line number Diff line number Diff line change
Expand Up @@ -412,110 +412,6 @@ resource "azurerm_monitor_autoscale_setting" "function_lollipop_itn" {
}
}

profile {
name = module.common_values.scaling_gate.name

fixed_date {
timezone = module.common_values.scaling_gate.timezone
start = module.common_values.scaling_gate.start
end = module.common_values.scaling_gate.end
}

capacity {
default = 20
minimum = 15
maximum = 30
}

rule {
metric_trigger {
metric_name = "Requests"
metric_resource_id = module.function_lollipop_itn.id
metric_namespace = "microsoft.web/sites"
time_grain = "PT1M"
statistic = "Max"
time_window = "PT1M"
time_aggregation = "Maximum"
operator = "GreaterThan"
threshold = 3000
divide_by_instance_count = true
}

scale_action {
direction = "Increase"
type = "ChangeCount"
value = "2"
cooldown = "PT1M"
}
}

rule {
metric_trigger {
metric_name = "CpuPercentage"
metric_resource_id = module.function_lollipop_itn.app_service_plan_id
metric_namespace = "microsoft.web/serverfarms"
time_grain = "PT1M"
statistic = "Max"
time_window = "PT1M"
time_aggregation = "Maximum"
operator = "GreaterThan"
threshold = 35
divide_by_instance_count = false
}

scale_action {
direction = "Increase"
type = "ChangeCount"
value = "4"
cooldown = "PT1M"
}
}

rule {
metric_trigger {
metric_name = "Requests"
metric_resource_id = module.function_lollipop_itn.id
metric_namespace = "microsoft.web/sites"
time_grain = "PT1M"
statistic = "Average"
time_window = "PT5M"
time_aggregation = "Average"
operator = "LessThan"
threshold = 300
divide_by_instance_count = true
}

scale_action {
direction = "Decrease"
type = "ChangeCount"
value = "1"
cooldown = "PT1M"
}
}

rule {
metric_trigger {
metric_name = "CpuPercentage"
metric_resource_id = module.function_lollipop_itn.app_service_plan_id
metric_namespace = "microsoft.web/serverfarms"
time_grain = "PT1M"
statistic = "Average"
time_window = "PT5M"
time_aggregation = "Average"
operator = "LessThan"
threshold = 15
divide_by_instance_count = false
}

scale_action {
direction = "Decrease"
type = "ChangeCount"
value = "1"
cooldown = "PT2M"
}
}
}

tags = var.tags
}

Expand Down
104 changes: 0 additions & 104 deletions src/domains/citizen-auth-app/09_function_profile.tf
Original file line number Diff line number Diff line change
Expand Up @@ -413,110 +413,6 @@ resource "azurerm_monitor_autoscale_setting" "function_profile" {
}
}
}

profile {
name = module.common_values.scaling_gate.name

fixed_date {
timezone = module.common_values.scaling_gate.timezone
start = module.common_values.scaling_gate.start
end = module.common_values.scaling_gate.end
}

capacity {
default = 20
minimum = 15
maximum = 30
}

rule {
metric_trigger {
metric_name = "Requests"
metric_resource_id = module.function_profile[count.index].id
metric_namespace = "microsoft.web/sites"
time_grain = "PT1M"
statistic = "Max"
time_window = "PT2M"
time_aggregation = "Maximum"
operator = "GreaterThan"
threshold = 2000
divide_by_instance_count = true
}

scale_action {
direction = "Increase"
type = "ChangeCount"
value = "2"
cooldown = "PT1M"
}
}

rule {
metric_trigger {
metric_name = "CpuPercentage"
metric_resource_id = module.function_profile[count.index].app_service_plan_id
metric_namespace = "microsoft.web/serverfarms"
time_grain = "PT1M"
statistic = "Max"
time_window = "PT1M"
time_aggregation = "Maximum"
operator = "GreaterThan"
threshold = 40
divide_by_instance_count = false
}

scale_action {
direction = "Increase"
type = "ChangeCount"
value = "4"
cooldown = "PT1M"
}
}

rule {
metric_trigger {
metric_name = "Requests"
metric_resource_id = module.function_profile[count.index].id
metric_namespace = "microsoft.web/sites"
time_grain = "PT1M"
statistic = "Average"
time_window = "PT5M"
time_aggregation = "Average"
operator = "LessThan"
threshold = 200
divide_by_instance_count = true
}

scale_action {
direction = "Decrease"
type = "ChangeCount"
value = "1"
cooldown = "PT1M"
}
}

rule {
metric_trigger {
metric_name = "CpuPercentage"
metric_resource_id = module.function_profile[count.index].app_service_plan_id
metric_namespace = "microsoft.web/serverfarms"
time_grain = "PT1M"
statistic = "Average"
time_window = "PT5M"
time_aggregation = "Average"
operator = "LessThan"
threshold = 15
divide_by_instance_count = false
}

scale_action {
direction = "Decrease"
type = "ChangeCount"
value = "1"
cooldown = "PT2M"
}
}
}
}

## Alerts
Expand Down
13 changes: 3 additions & 10 deletions src/domains/functions/function_assets_cdn.tf
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,6 @@ module "function_assets_cdn_autoscale" {
function_app_name = module.function_assets_cdn.name
}
scheduler = {
spot_load = {
name = module.common_values.scaling_gate.name
minimum = 3
default = 3
start_date = module.common_values.scaling_gate.start
end_date = module.common_values.scaling_gate.end
},
normal_load = {
minimum = 2
default = 2
Expand All @@ -146,15 +139,15 @@ module "function_assets_cdn_autoscale" {
time_aggregation_decrease = "Average"
lower_threshold = 200
decrease_by = 1
cooldown_decrease = 1
cooldown_decrease = 2
}
cpu = {
upper_threshold = 35
upper_threshold = 50
lower_threshold = 15
increase_by = 3
decrease_by = 1
cooldown_increase = 1
cooldown_decrease = 20
cooldown_decrease = 2
statistic_increase = "Max"
statistic_decrease = "Average"
time_aggregation_increase = "Maximum"
Expand Down
104 changes: 0 additions & 104 deletions src/domains/functions/function_services.tf
Original file line number Diff line number Diff line change
Expand Up @@ -411,110 +411,6 @@ resource "azurerm_monitor_autoscale_setting" "function_services_autoscale" {
}
}
}

profile {
name = module.common_values.scaling_gate.name

capacity {
default = var.function_services_autoscale_default
minimum = 6
maximum = var.function_services_autoscale_maximum
}

fixed_date {
timezone = module.common_values.scaling_gate.timezone
start = module.common_values.scaling_gate.start
end = module.common_values.scaling_gate.end
}

rule {
metric_trigger {
metric_name = "Requests"
metric_resource_id = module.function_services[count.index].id
metric_namespace = "microsoft.web/sites"
time_grain = "PT1M"
statistic = "Max"
time_window = "PT1M"
time_aggregation = "Maximum"
operator = "GreaterThan"
threshold = 3000
divide_by_instance_count = true
}

scale_action {
direction = "Increase"
type = "ChangeCount"
value = "2"
cooldown = "PT1M"
}
}

rule {
metric_trigger {
metric_name = "CpuPercentage"
metric_resource_id = module.function_services[count.index].app_service_plan_id
metric_namespace = "microsoft.web/serverfarms"
time_grain = "PT1M"
statistic = "Max"
time_window = "PT1M"
time_aggregation = "Maximum"
operator = "GreaterThan"
threshold = 40
divide_by_instance_count = false
}

scale_action {
direction = "Increase"
type = "ChangeCount"
value = "3"
cooldown = "PT2M"
}
}

rule {
metric_trigger {
metric_name = "Requests"
metric_resource_id = module.function_services[count.index].id
metric_namespace = "microsoft.web/sites"
time_grain = "PT1M"
statistic = "Average"
time_window = "PT5M"
time_aggregation = "Average"
operator = "LessThan"
threshold = 300
divide_by_instance_count = true
}

scale_action {
direction = "Decrease"
type = "ChangeCount"
value = "1"
cooldown = "PT1M"
}
}

rule {
metric_trigger {
metric_name = "CpuPercentage"
metric_resource_id = module.function_services[count.index].app_service_plan_id
metric_namespace = "microsoft.web/serverfarms"
time_grain = "PT1M"
statistic = "Average"
time_window = "PT5M"
time_aggregation = "Average"
operator = "LessThan"
threshold = 15
divide_by_instance_count = false
}

scale_action {
direction = "Decrease"
type = "ChangeCount"
value = "1"
cooldown = "PT2M"
}
}
}
}

# Cosmos container for subscription cidrs
Expand Down
Loading

0 comments on commit 68b2531

Please sign in to comment.