Skip to content

Commit 59043db

Browse files
committed
feat: add anomaly_detection support to workload scaling policy
1 parent 66d4741 commit 59043db

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ module "castai_gke_cluster" {
217217
}
218218
}
219219
220+
anomaly_detection = {
221+
cpu_pressure = {
222+
cpu_stall_threshold_percentage = 50
223+
min_pressured_pod_percentage = 30
224+
}
225+
}
226+
220227
excluded_containers = ["container-1", "container-2"]
221228
}
222229
}

main.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,19 @@ resource "castai_workload_scaling_policy" "this" {
373373
}
374374
}
375375
}
376+
377+
dynamic "anomaly_detection" {
378+
for_each = try([each.value.anomaly_detection], [])
379+
content {
380+
dynamic "cpu_pressure" {
381+
for_each = try([anomaly_detection.value.cpu_pressure], [])
382+
content {
383+
cpu_stall_threshold_percentage = try(cpu_pressure.value.cpu_stall_threshold_percentage, null)
384+
min_pressured_pod_percentage = try(cpu_pressure.value.min_pressured_pod_percentage, null)
385+
}
386+
}
387+
}
388+
}
376389
}
377390

378391
resource "castai_workload_custom_metrics_data_source" "this" {

0 commit comments

Comments
 (0)