Skip to content

Commit 0a95fce

Browse files
rppala90hyder
authored andcommitted
Add support for preemptible worker nodes
1 parent 48c4ced commit 0a95fce

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

modules/oke/nodepools.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ resource "oci_containerengine_node_pool" "nodepools" {
3232
content {
3333
availability_domain = ad_iterator.value
3434
subnet_id = var.cluster_subnets["workers"]
35+
dynamic "preemptible_node_config" {
36+
for_each = lookup(lookup(each.value, "preemptible_config", {}), "enable", false)? [1]: []
37+
content {
38+
preemption_action {
39+
type = "TERMINATE"
40+
is_preserve_boot_volume = lookup(lookup(each.value, "preemptible_config", {}), "is_preserve_boot_volume", false)
41+
}
42+
}
43+
}
3544
}
3645
}
3746

terraform.tfvars.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,16 @@ enable_pv_encryption_in_transit = false
205205
kubeproxy_mode = "iptables"
206206
node_pools = {
207207
# Basic node pool
208+
#preemptible = {
209+
# shape = "VM.Standard.1.1",
210+
# ocpus = 1,
211+
# memory = 1,
212+
# node_pool_size = 1,
213+
# boot_volume_size = 150,
214+
# eviction_grace_duration = 0, //Grade duration in minutes. Service default is 60.
215+
# force_node_delete = true
216+
# preemptible_config = {"enable": true, "is_preserve_boot_volume": true}
217+
#}
208218
#np1 = {
209219
# shape = "VM.Standard.E4.Flex",
210220
# ocpus = 2,

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ terraform {
66
oci = {
77
source = "oracle/oci"
88
configuration_aliases = [oci.home]
9-
version = "~> 4.114.0"
9+
version = "~> 4.115.0"
1010
}
1111
}
1212
required_version = ">= 1.2.0"

0 commit comments

Comments
 (0)