Skip to content

Commit 3b5dcad

Browse files
feat: Add JVM optimization settings and excluded containers to workload scaling policy (#142)
1 parent 16ce4c5 commit 3b5dcad

File tree

3 files changed

+31
-9
lines changed

3 files changed

+31
-9
lines changed

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,14 @@ module "castai_gke_cluster" {
210210
enabled = true
211211
}
212212
}
213+
214+
jvm = {
215+
memory = {
216+
optimization = true
217+
}
218+
}
219+
220+
excluded_containers = ["container-1", "container-2"]
213221
}
214222
}
215223
}
@@ -495,7 +503,7 @@ Usage examples are located in [terraform provider repo](https://github.com/casta
495503
| Name | Version |
496504
|------|---------|
497505
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
498-
| <a name="requirement_castai"></a> [castai](#requirement\_castai) | >= 8.3 |
506+
| <a name="requirement_castai"></a> [castai](#requirement\_castai) | >= 8.24.0 |
499507
| <a name="requirement_google"></a> [google](#requirement\_google) | >= 2.49 |
500508
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 3.0.0 |
501509
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 3.0 |
@@ -504,10 +512,10 @@ Usage examples are located in [terraform provider repo](https://github.com/casta
504512
505513
| Name | Version |
506514
|------|---------|
507-
| <a name="provider_castai"></a> [castai](#provider\_castai) | 7.61.0 |
508-
| <a name="provider_google"></a> [google](#provider\_google) | 6.46.0 |
509-
| <a name="provider_helm"></a> [helm](#provider\_helm) | 3.0.2 |
510-
| <a name="provider_null"></a> [null](#provider\_null) | >= 3.0 |
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 |
511519
512520
## Modules
513521
@@ -541,9 +549,9 @@ Usage examples are located in [terraform provider repo](https://github.com/casta
541549
| [helm_release.castai_pod_pinner_self_managed](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
542550
| [helm_release.castai_spot_handler](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
543551
| [helm_release.castai_workload_autoscaler](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
544-
| [helm_release.castai_workload_autoscaler_self_managed](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
545552
| [helm_release.castai_workload_autoscaler_exporter](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
546553
| [helm_release.castai_workload_autoscaler_exporter_self_managed](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
554+
| [helm_release.castai_workload_autoscaler_self_managed](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
547555
| [null_resource.wait_for_cluster](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
548556
| [google_compute_subnetwork.gke_subnet](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_subnetwork) | data source |
549557
| [google_container_cluster.gke](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/container_cluster) | data source |
@@ -598,10 +606,10 @@ Usage examples are located in [terraform provider repo](https://github.com/casta
598606
| <a name="input_spot_handler_values"></a> [spot\_handler\_values](#input\_spot\_handler\_values) | List of YAML formatted string values for spot-handler helm chart | `list(string)` | `[]` | no |
599607
| <a name="input_spot_handler_version"></a> [spot\_handler\_version](#input\_spot\_handler\_version) | Version of castai-spot-handler helm chart. Default latest | `string` | `null` | no |
600608
| <a name="input_wait_for_cluster_ready"></a> [wait\_for\_cluster\_ready](#input\_wait\_for\_cluster\_ready) | Wait for cluster to be ready before finishing the module execution, this option requires `castai_api_token` to be set | `bool` | `false` | no |
609+
| <a name="input_workload_autoscaler_exporter_values"></a> [workload\_autoscaler\_exporter\_values](#input\_workload\_autoscaler\_exporter\_values) | List of YAML formatted string with castai-workload-autoscaler-exporter values | `list(string)` | `[]` | no |
610+
| <a name="input_workload_autoscaler_exporter_version"></a> [workload\_autoscaler\_exporter\_version](#input\_workload\_autoscaler\_exporter\_version) | Version of castai-workload-autoscaler-exporter helm chart. Default latest | `string` | `null` | no |
601611
| <a name="input_workload_autoscaler_values"></a> [workload\_autoscaler\_values](#input\_workload\_autoscaler\_values) | List of YAML formatted string with cluster-workload-autoscaler values | `list(string)` | `[]` | no |
602612
| <a name="input_workload_autoscaler_version"></a> [workload\_autoscaler\_version](#input\_workload\_autoscaler\_version) | Version of castai-workload-autoscaler helm chart. Default latest | `string` | `null` | no |
603-
| <a name="input_workload_autoscaler_exporter_values"></a> [workload\_autoscaler\_exporter\_values](#input\_workload\_autoscaler\_exporter\_values) | List of YAML formatted string with workload-autoscaler-exporter values | `list(string)` | `[]` | no |
604-
| <a name="input_workload_autoscaler_exporter_version"></a> [workload\_autoscaler\_exporter\_version](#input\_workload\_autoscaler\_exporter\_version) | Version of castai-workload-autoscaler-exporter helm chart. Default latest | `string` | `null` | no |
605613
| <a name="input_workload_scaling_policies"></a> [workload\_scaling\_policies](#input\_workload\_scaling\_policies) | Map of workload scaling policies to create | `any` | `{}` | no |
606614

607615
## Outputs

main.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ resource "castai_workload_scaling_policy" "this" {
211211
apply_type = try(each.value.apply_type, "DEFERRED")
212212
management_option = try(each.value.management_option, "READ_ONLY")
213213

214+
excluded_containers = try(each.value.excluded_containers, null)
215+
214216
cpu {
215217
function = try(each.value.cpu.function, "QUANTILE")
216218
overhead = try(each.value.cpu.overhead, 0)
@@ -358,6 +360,18 @@ resource "castai_workload_scaling_policy" "this" {
358360
prefer_one_by_one = try(rollout_behavior.value.prefer_one_by_one, null)
359361
}
360362
}
363+
364+
dynamic "jvm" {
365+
for_each = try([each.value.jvm], [])
366+
content {
367+
dynamic "memory" {
368+
for_each = try([jvm.value.memory], [])
369+
content {
370+
optimization = try(memory.value.optimization, null)
371+
}
372+
}
373+
}
374+
}
361375
}
362376

363377
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.16"
11+
version = ">= 8.24.0"
1212
}
1313
helm = {
1414
source = "hashicorp/helm"

0 commit comments

Comments
 (0)