Skip to content

Commit

Permalink
Add support for preemptible worker nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
rppala90 authored and hyder committed Apr 12, 2023
1 parent 48c4ced commit 0a95fce
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
9 changes: 9 additions & 0 deletions modules/oke/nodepools.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ resource "oci_containerengine_node_pool" "nodepools" {
content {
availability_domain = ad_iterator.value
subnet_id = var.cluster_subnets["workers"]
dynamic "preemptible_node_config" {
for_each = lookup(lookup(each.value, "preemptible_config", {}), "enable", false)? [1]: []
content {
preemption_action {
type = "TERMINATE"
is_preserve_boot_volume = lookup(lookup(each.value, "preemptible_config", {}), "is_preserve_boot_volume", false)
}
}
}
}
}

Expand Down
10 changes: 10 additions & 0 deletions terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,16 @@ enable_pv_encryption_in_transit = false
kubeproxy_mode = "iptables"
node_pools = {
# Basic node pool
#preemptible = {
# shape = "VM.Standard.1.1",
# ocpus = 1,
# memory = 1,
# node_pool_size = 1,
# boot_volume_size = 150,
# eviction_grace_duration = 0, //Grade duration in minutes. Service default is 60.
# force_node_delete = true
# preemptible_config = {"enable": true, "is_preserve_boot_volume": true}
#}
#np1 = {
# shape = "VM.Standard.E4.Flex",
# ocpus = 2,
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
oci = {
source = "oracle/oci"
configuration_aliases = [oci.home]
version = "~> 4.114.0"
version = "~> 4.115.0"
}
}
required_version = ">= 1.2.0"
Expand Down

0 comments on commit 0a95fce

Please sign in to comment.