From 5ff67ea1b0e365d7f389e0d16415cd86733c739b Mon Sep 17 00:00:00 2001 From: hezijie Date: Mon, 19 Feb 2024 13:39:17 +0800 Subject: [PATCH] update extra node pool's name suffix, use uuid() as random seed --- examples/multiple_node_pools/main.tf | 1 + extra_node_pool.tf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/multiple_node_pools/main.tf b/examples/multiple_node_pools/main.tf index a9ee476a..be3e670b 100644 --- a/examples/multiple_node_pools/main.tf +++ b/examples/multiple_node_pools/main.tf @@ -38,6 +38,7 @@ locals { vm_size = "Standard_D2s_v3" node_count = 1 vnet_subnet_id = azurerm_subnet.test.id + create_before_destroy = i % 2 == 0 } } } diff --git a/extra_node_pool.tf b/extra_node_pool.tf index 7641b48c..f7a121a5 100644 --- a/extra_node_pool.tf +++ b/extra_node_pool.tf @@ -7,7 +7,7 @@ resource "azurerm_kubernetes_cluster_node_pool" "node_pool_create_before_destroy for_each = local.node_pools_create_before_destroy kubernetes_cluster_id = azurerm_kubernetes_cluster.main.id - name = "${each.value.name}${substr(md5(jsonencode(each.value)), 0, 4)}" + name = "${each.value.name}${substr(md5(uuid()), 0, 4)}" vm_size = each.value.vm_size capacity_reservation_group_id = each.value.capacity_reservation_group_id custom_ca_trust_enabled = each.value.custom_ca_trust_enabled