Skip to content

Commit

Permalink
feat: Ability to define bursting for instance and instance-pool
Browse files Browse the repository at this point in the history
Added the ability to define burstability for worker pool mode instance and
instance-pool.

Signed-off-by: Deepak Devadathan <[email protected]>
  • Loading branch information
ddevadat authored and hyder committed Dec 11, 2024
1 parent 2c7037a commit a5cdd82
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions examples/workers/vars-workers-instance.auto.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ worker_pools = {
"vnic-display-name" = {},
},
},
oke-vm-instance-burst = {
description = "Self-managed Instance With Bursting",
mode = "instance",
size = 1,
burst = "BASELINE_1_8", # Valid values BASELINE_1_8,BASELINE_1_2
},
}
6 changes: 6 additions & 0 deletions examples/workers/vars-workers-instancepool.auto.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ worker_pools = {
"vnic-display-name" = {},
},
},
oke-vm-instance-pool-burst = {
description = "Self-managed Instance Pool With Bursting",
mode = "instance-pool",
size = 1,
burst = "BASELINE_1_8", # Valid values BASELINE_1_8,BASELINE_1_2
}
}
3 changes: 2 additions & 1 deletion modules/workers/instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ resource "oci_core_instance" "workers" {
dynamic "shape_config" {
for_each = length(regexall("Flex", each.value.shape)) > 0 ? [1] : []
content {
ocpus = each.value.ocpus
baseline_ocpu_utilization = lookup(each.value, "burst", "BASELINE_1_1")
ocpus = each.value.ocpus
memory_in_gbs = ( # If > 64GB memory/core, correct input to exactly 64GB memory/core
(each.value.memory / each.value.ocpus) > 64 ? each.value.ocpus * 64 : each.value.memory
)
Expand Down
3 changes: 2 additions & 1 deletion modules/workers/instanceconfig.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ resource "oci_core_instance_configuration" "workers" {
dynamic "shape_config" {
for_each = length(regexall("Flex", each.value.shape)) > 0 ? [1] : []
content {
ocpus = each.value.ocpus
baseline_ocpu_utilization = lookup(each.value, "burst", "BASELINE_1_1")
ocpus = each.value.ocpus
memory_in_gbs = ( # If > 64GB memory/core, correct input to exactly 64GB memory/core
(each.value.memory / each.value.ocpus) > 64 ? each.value.ocpus * 64 : each.value.memory
)
Expand Down

0 comments on commit a5cdd82

Please sign in to comment.