Skip to content

Commit

Permalink
Support cloud-init update for cluster networks and instancepools. Fix…
Browse files Browse the repository at this point in the history
… IAM prerequisite dependency. Fix workers output
  • Loading branch information
robo-cap authored and hyder committed Oct 29, 2024
1 parent 3bdf976 commit 98b246f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions module-iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ module "iam_cluster_prerequisites" {
operator_volume_kms_key_id = var.operator_volume_kms_key_id
worker_volume_kms_key_id = var.worker_volume_kms_key_id

autoscaler_compartments = local.autoscaler_compartments
worker_compartments = local.worker_compartments
autoscaler_compartments = []
worker_compartments = []

providers = {
oci.home = oci.home
Expand Down
1 change: 0 additions & 1 deletion modules/workers/instanceconfig.tf
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ resource "oci_core_instance_configuration" "workers" {
create_before_destroy = true
ignore_changes = [
defined_tags, freeform_tags, display_name,
instance_details[0].launch_details[0].metadata,
instance_details[0].launch_details[0].defined_tags,
instance_details[0].launch_details[0].freeform_tags,
instance_details[0].launch_details[0].create_vnic_details[0].defined_tags,
Expand Down
12 changes: 6 additions & 6 deletions modules/workers/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ locals {
{
"oke.oraclecloud.com/tf.module" = "terraform-oci-oke"
"oke.oraclecloud.com/tf.state_id" = var.state_id
"oke.oraclecloud.com/tf.workspace" = terraform.workspace
# "oke.oraclecloud.com/tf.workspace" = terraform.workspace
"oke.oraclecloud.com/pool.name" = pool_name
"oke.oraclecloud.com/pool.mode" = pool.mode
"oke.oraclecloud.com/cluster_autoscaler" = pool.allow_autoscaler ? "allowed" : "disabled"
Expand Down Expand Up @@ -232,11 +232,11 @@ locals {
}

# Maps of worker pool OCI resources by pool name enriched with desired/custom parameters for various modes
worker_node_pools = { for k, v in merge(oci_containerengine_node_pool.tfscaled_workers, oci_containerengine_node_pool.autoscaled_workers) : k => merge(v, lookup(local.worker_pools_final, k, {})) }
worker_virtual_node_pools = { for k, v in oci_containerengine_virtual_node_pool.workers : k => merge(v, lookup(local.worker_pools_final, k, {})) }
worker_instance_pools = { for k, v in merge(oci_core_instance_pool.tfscaled_workers, oci_core_instance_pool.autoscaled_workers) : k => merge(v, lookup(local.worker_pools_final, k, {})) }
worker_cluster_networks = { for k, v in oci_core_cluster_network.workers : k => merge(v, lookup(local.worker_pools_final, k, {})) }
worker_instances = { for k, v in oci_core_instance.workers : k => merge(v, lookup(local.worker_pools_final, k, {})) }
worker_node_pools = { for k, v in merge(oci_containerengine_node_pool.tfscaled_workers, oci_containerengine_node_pool.autoscaled_workers) : k => merge(lookup(local.worker_pools_final, k, {}), v) }
worker_virtual_node_pools = { for k, v in oci_containerengine_virtual_node_pool.workers : k => merge(lookup(local.worker_pools_final, k, {}), v) }
worker_instance_pools = { for k, v in merge(oci_core_instance_pool.tfscaled_workers, oci_core_instance_pool.autoscaled_workers) : k => merge(lookup(local.worker_pools_final, k, {}), v) }
worker_cluster_networks = { for k, v in oci_core_cluster_network.workers : k => merge(lookup(local.worker_pools_final, k, {}), v) }
worker_instances = { for k, v in oci_core_instance.workers : k => merge(lookup(local.worker_pools_final, k, {}), v) }

# Combined map of outputs by pool name for all modes excluding 'instance' (output separately)
worker_pools_output = merge(
Expand Down

0 comments on commit 98b246f

Please sign in to comment.