Skip to content

Commit 4780918

Browse files
mszostokclaude
andcommitted
feat: add anomaly_detection support to workload scaling policy
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3b5dcad commit 4780918

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

README.md

Lines changed: 12 additions & 5 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
}
@@ -503,7 +510,7 @@ Usage examples are located in [terraform provider repo](https://github.com/casta
503510
| Name | Version |
504511
|------|---------|
505512
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
506-
| <a name="requirement_castai"></a> [castai](#requirement\_castai) | >= 8.24.0 |
513+
| <a name="requirement_castai"></a> [castai](#requirement\_castai) | >= 8.26.0 |
507514
| <a name="requirement_google"></a> [google](#requirement\_google) | >= 2.49 |
508515
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 3.0.0 |
509516
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 3.0 |
@@ -512,10 +519,10 @@ Usage examples are located in [terraform provider repo](https://github.com/casta
512519
513520
| Name | Version |
514521
|------|---------|
515-
| <a name="provider_castai"></a> [castai](#provider\_castai) | 8.24.0 |
516-
| <a name="provider_google"></a> [google](#provider\_google) | 7.25.0 |
517-
| <a name="provider_helm"></a> [helm](#provider\_helm) | 3.1.1 |
518-
| <a name="provider_null"></a> [null](#provider\_null) | 3.2.4 |
522+
| <a name="provider_castai"></a> [castai](#provider\_castai) | >= 8.26.0 |
523+
| <a name="provider_google"></a> [google](#provider\_google) | >= 2.49 |
524+
| <a name="provider_helm"></a> [helm](#provider\_helm) | >= 3.0.0 |
525+
| <a name="provider_null"></a> [null](#provider\_null) | >= 3.0 |
519526
520527
## Modules
521528

main.tf

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

377390
resource "helm_release" "castai_agent" {

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ terraform {
88
}
99
castai = {
1010
source = "castai/castai"
11-
version = ">= 8.24.0"
11+
version = ">= 8.26.0"
1212
}
1313
helm = {
1414
source = "hashicorp/helm"

0 commit comments

Comments
 (0)