From 401111bde0ec5f3f149785b8e8bf91d6214d797b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Fri, 31 May 2024 23:10:18 +0200 Subject: [PATCH] `azurerm_kubernetes_cluster` - Support in-place update of `network_profile.network_policy` --- ...kubernetes_cluster_addons_resource_test.go | 45 ++-- .../kubernetes_cluster_auth_resource_test.go | 30 +-- ...ernetes_cluster_extension_resource_test.go | 2 +- ...ubernetes_cluster_network_resource_test.go | 245 ++++++++++++++---- ...ernetes_cluster_node_pool_resource_test.go | 96 +++---- .../kubernetes_cluster_other_resource_test.go | 106 ++++---- .../containers/kubernetes_cluster_resource.go | 8 +- .../kubernetes_cluster_resource_test.go | 20 +- ...ubernetes_cluster_resource_upgrade_test.go | 12 +- ...ubernetes_cluster_scaling_resource_test.go | 24 +- ...d_access_role_binding_resource_gen_test.go | 2 +- ...bernetes_fleet_member_resource_gen_test.go | 2 +- ...bernetes_fleet_update_run_resource_test.go | 2 +- 13 files changed, 380 insertions(+), 214 deletions(-) diff --git a/internal/services/containers/kubernetes_cluster_addons_resource_test.go b/internal/services/containers/kubernetes_cluster_addons_resource_test.go index edb9d5e0af82d..cfd575f144a1a 100644 --- a/internal/services/containers/kubernetes_cluster_addons_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_addons_resource_test.go @@ -338,6 +338,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -350,7 +351,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -402,6 +403,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -413,7 +415,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -447,6 +449,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -459,7 +462,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -510,6 +513,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -522,7 +526,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -575,6 +579,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -587,7 +592,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -621,6 +626,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -633,7 +639,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -662,6 +668,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -674,7 +681,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -786,6 +793,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -798,7 +806,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -835,6 +843,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -847,7 +856,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -881,6 +890,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -893,7 +903,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -936,6 +946,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -948,7 +959,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -986,6 +997,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -998,7 +1010,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1029,6 +1041,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -1041,7 +1054,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1075,6 +1088,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -1087,7 +1101,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1120,6 +1134,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -1132,7 +1147,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } diff --git a/internal/services/containers/kubernetes_cluster_auth_resource_test.go b/internal/services/containers/kubernetes_cluster_auth_resource_test.go index e8a9bfdf0cb49..58457e88cabdf 100644 --- a/internal/services/containers/kubernetes_cluster_auth_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_auth_resource_test.go @@ -459,7 +459,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -506,7 +506,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -545,7 +545,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -586,7 +586,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -644,7 +644,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -692,7 +692,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -735,7 +735,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -778,7 +778,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -826,7 +826,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -874,7 +874,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -922,7 +922,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -969,7 +969,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1015,7 +1015,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1063,7 +1063,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1126,7 +1126,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } diff --git a/internal/services/containers/kubernetes_cluster_extension_resource_test.go b/internal/services/containers/kubernetes_cluster_extension_resource_test.go index 92704997a1c2b..a13d6e008421b 100644 --- a/internal/services/containers/kubernetes_cluster_extension_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_extension_resource_test.go @@ -133,7 +133,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } diff --git a/internal/services/containers/kubernetes_cluster_network_resource_test.go b/internal/services/containers/kubernetes_cluster_network_resource_test.go index e8bb0e3cf17d9..ed944a20a84ba 100644 --- a/internal/services/containers/kubernetes_cluster_network_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_network_resource_test.go @@ -258,6 +258,52 @@ func TestAccKubernetesCluster_advancedNetworkingAzureCiliumPolicyUpdate(t *testi }) } +func TestAccKubernetesCluster_advancedNetworkingAzureAzurePolicyUpdate(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") + r := KubernetesClusterResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.advancedNetworkingWithOptionalPolicyConfig(data, "azure", ""), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.advancedNetworkingWithOptionalPolicyConfig(data, "azure", "azure"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("network_profile.0.network_policy").HasValue("azure"), + ), + }, + data.ImportStep(), + }) +} + +func TestAccKubernetesCluster_advancedNetworkingAzureCalicoPolicyUpdate(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") + r := KubernetesClusterResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.advancedNetworkingWithOptionalPolicyConfig(data, "azure", ""), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.advancedNetworkingWithOptionalPolicyConfig(data, "azure", "calico"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("network_profile.0.network_policy").HasValue("calico"), + ), + }, + data.ImportStep(), + }) +} + func TestAccKubernetesCluster_advancedNetworkingAzureCalicoPolicyComplete(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") r := KubernetesClusterResource{} @@ -1070,6 +1116,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" api_server_access_profile { vnet_integration_enabled = true @@ -1087,7 +1134,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test1.id upgrade_settings { max_surge = "10%%" @@ -1126,6 +1173,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" api_server_access_profile { vnet_integration_enabled = true @@ -1142,7 +1190,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1189,6 +1237,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -1201,7 +1250,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -1261,7 +1310,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -1330,7 +1379,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -1398,7 +1447,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -1454,6 +1503,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -1466,7 +1516,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -1518,6 +1568,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -1530,7 +1581,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -1579,11 +1630,12 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%[2]d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -1603,6 +1655,64 @@ resource "azurerm_kubernetes_cluster" "test" { `, data.Locations.Primary, data.RandomInteger) } +func (KubernetesClusterResource) advancedNetworkingWithOptionalPolicyConfig(data acceptance.TestData, networkPlugin, networkPolicy string) string { + if networkPolicy != "" { + networkPolicy = fmt.Sprintf("network_policy = %q", networkPolicy) + } + + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-aks-%[2]d" + location = "%[1]s" +} + +resource "azurerm_virtual_network" "test" { + name = "acctestvirtnet%[2]d" + address_space = ["10.1.0.0/16"] + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name +} + +resource "azurerm_subnet" "test" { + name = "acctestsubnet%[2]d" + resource_group_name = azurerm_resource_group.test.name + virtual_network_name = azurerm_virtual_network.test.name + address_prefixes = ["10.1.0.0/24"] +} + +resource "azurerm_kubernetes_cluster" "test" { + name = "acctestaks%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + dns_prefix = "acctestaks%[2]d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" + + default_node_pool { + name = "default" + node_count = 2 + vm_size = "Standard_D2s_v5" + vnet_subnet_id = azurerm_subnet.test.id + upgrade_settings { + max_surge = "10%%" + } + } + + identity { + type = "SystemAssigned" + } + + network_profile { + network_plugin = "%[3]s" + %[4]s + } +} +`, data.Locations.Primary, data.RandomInteger, networkPlugin, networkPolicy) +} + func (KubernetesClusterResource) advancedNetworkingWithCiliumPolicyConfig(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { @@ -1633,11 +1743,12 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%[2]d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -1707,6 +1818,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -1719,7 +1831,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -1789,6 +1901,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -1801,7 +1914,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -1839,11 +1952,12 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_node_public_ip = true upgrade_settings { max_surge = "10%%" @@ -1887,6 +2001,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -1899,7 +2014,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id max_pods = 60 upgrade_settings { @@ -1937,11 +2052,12 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_node_public_ip = true node_public_ip_prefix_id = azurerm_public_ip_prefix.test.id upgrade_settings { @@ -1972,11 +2088,12 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" max_pods = 60 upgrade_settings { max_surge = "10%%" @@ -2015,11 +2132,12 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" max_pods = 60 upgrade_settings { max_surge = "10%%" @@ -2101,11 +2219,12 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" max_pods = 60 vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { @@ -2145,11 +2264,12 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" max_pods = 60 upgrade_settings { max_surge = "10%%" @@ -2188,6 +2308,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" private_cluster_enabled = %t linux_profile { @@ -2201,7 +2322,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2252,6 +2373,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" private_cluster_enabled = %t private_dns_zone_id = azurerm_private_dns_zone.test.id @@ -2266,7 +2388,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2330,6 +2452,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%[1]d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" private_cluster_enabled = %[3]t private_dns_zone_id = azurerm_private_dns_zone.test.id @@ -2349,7 +2472,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2397,6 +2520,7 @@ resource "azurerm_kubernetes_cluster" "test" { resource_group_name = azurerm_resource_group.test.name private_cluster_enabled = true private_dns_zone_id = azurerm_private_dns_zone.test.id + node_resource_group = "${azurerm_resource_group.test.name}-nodes" dns_prefix_private_cluster = "prefix" linux_profile { @@ -2409,7 +2533,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2448,6 +2572,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" private_cluster_enabled = %t private_dns_zone_id = "System" @@ -2462,7 +2587,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2492,11 +2617,12 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2526,11 +2652,12 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2561,11 +2688,12 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2596,11 +2724,12 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2650,6 +2779,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" kubernetes_version = "%s" linux_profile { @@ -2663,7 +2793,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -2730,6 +2860,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" linux_profile { admin_username = "acctestuser%d" @@ -2742,7 +2873,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -2793,6 +2924,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" kubernetes_version = "%s" linux_profile { @@ -2806,7 +2938,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -2866,6 +2998,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" kubernetes_version = "%s" linux_profile { @@ -2879,7 +3012,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -2931,6 +3064,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%[1]d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" kubernetes_version = "%[3]s" linux_profile { @@ -2944,7 +3078,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2998,6 +3132,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" kubernetes_version = "%s" linux_profile { @@ -3011,7 +3146,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -3070,6 +3205,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" kubernetes_version = "%s" linux_profile { @@ -3083,7 +3219,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -3146,6 +3282,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" kubernetes_version = "%s" linux_profile { @@ -3158,7 +3295,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -3221,6 +3358,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" kubernetes_version = "%s" linux_profile { @@ -3233,7 +3371,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -3296,6 +3434,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" kubernetes_version = "%s" linux_profile { @@ -3308,7 +3447,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -3371,6 +3510,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" kubernetes_version = "%s" linux_profile { @@ -3383,7 +3523,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -3536,6 +3676,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" kubernetes_version = "%s" linux_profile { @@ -3548,7 +3689,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -3706,6 +3847,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" kubernetes_version = "%s" linux_profile { @@ -3718,7 +3860,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -3870,6 +4012,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" kubernetes_version = "%s" linux_profile { @@ -3882,7 +4025,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -3985,6 +4128,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" kubernetes_version = "%s" linux_profile { @@ -3997,7 +4141,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -4065,10 +4209,11 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%[2]d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -4117,10 +4262,11 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%[2]d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -4166,10 +4312,11 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%[2]d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -4209,10 +4356,11 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%[2]d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_node_public_ip = true node_network_profile { node_public_ip_tags = { @@ -4252,10 +4400,11 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%[2]d" + node_resource_group = "${azurerm_resource_group.test.name}-nodes" default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_node_public_ip = true node_network_profile { allowed_host_ports { diff --git a/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go b/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go index 0cdb6b7eb58b7..a461ea69501de 100644 --- a/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go @@ -1185,7 +1185,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_auto_scaling = true min_count = 1 max_count = 3 @@ -1204,7 +1204,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_auto_scaling = true min_count = %d max_count = %d @@ -1233,7 +1233,7 @@ resource "azurerm_kubernetes_cluster" "test" { name = "default" node_count = 1 type = "AvailabilitySet" - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1247,7 +1247,7 @@ resource "azurerm_kubernetes_cluster" "test" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) @@ -1273,7 +1273,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1287,7 +1287,7 @@ resource "azurerm_kubernetes_cluster" "test" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 kubelet_config { @@ -1364,7 +1364,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1378,7 +1378,7 @@ resource "azurerm_kubernetes_cluster" "test" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 kubelet_config { @@ -1434,7 +1434,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -1454,7 +1454,7 @@ resource "azurerm_kubernetes_cluster" "test" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 vnet_subnet_id = azurerm_subnet.test.id zones = ["1"] @@ -1547,7 +1547,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 tags = { @@ -1568,7 +1568,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 lifecycle { @@ -1591,7 +1591,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 tags = { @@ -1618,7 +1618,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "first" { name = "first" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 } @@ -1642,7 +1642,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "first" { name = "first" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = %d } @@ -1666,7 +1666,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = %d } `, r.templateConfig(data), numberOfAgents) @@ -1700,7 +1700,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 mode = "System" } @@ -1718,7 +1718,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 mode = "User" } @@ -1736,7 +1736,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "autoscale" { name = "autoscale" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_auto_scaling = true min_count = 1 max_count = 3 @@ -1767,7 +1767,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 node_labels = { %s @@ -1792,7 +1792,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 node_taints = [ %s @@ -1819,7 +1819,7 @@ resource "azurerm_public_ip_prefix" "test" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 enable_node_public_ip = true node_public_ip_prefix_id = azurerm_public_ip_prefix.test.id @@ -1872,7 +1872,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" pod_subnet_id = azurerm_subnet.podsubnet.id vnet_subnet_id = azurerm_subnet.nodesubnet.id upgrade_settings { @@ -1889,7 +1889,7 @@ resource "azurerm_kubernetes_cluster" "test" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 pod_subnet_id = azurerm_subnet.podsubnet.id vnet_subnet_id = azurerm_subnet.nodesubnet.id @@ -1921,7 +1921,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 os_disk_size_gb = 100 } @@ -1945,7 +1945,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1965,7 +1965,7 @@ resource "azurerm_proximity_placement_group" "test" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 proximity_placement_group_id = azurerm_proximity_placement_group.test.id } @@ -2000,7 +2000,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 priority = "Spot" eviction_policy = "Delete" @@ -2028,7 +2028,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 3 upgrade_settings { max_surge = "10%%" @@ -2050,7 +2050,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_auto_scaling = true min_count = 1 max_count = 3 @@ -2070,7 +2070,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 vnet_subnet_id = azurerm_subnet.test.id } @@ -2095,7 +2095,7 @@ resource "azurerm_subnet" "test2" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 vnet_subnet_id = azurerm_subnet.test2.id } @@ -2113,7 +2113,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "windoz" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 os_type = "Windows" tags = { @@ -2134,7 +2134,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "windoz" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 os_type = "Windows" os_sku = "Windows2019" @@ -2156,7 +2156,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "windoz" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 os_type = "Windows" os_sku = "Windows2022" @@ -2178,14 +2178,14 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "linux" { name = "linux" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 } resource "azurerm_kubernetes_cluster_node_pool" "windows" { name = "windoz" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 os_type = "Windows" } @@ -2208,7 +2208,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2251,7 +2251,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test.id upgrade_settings { max_surge = "10%%" @@ -2281,7 +2281,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2317,7 +2317,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_auto_scaling = true min_count = 0 max_count = 3 @@ -2337,7 +2337,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_host_encryption = true node_count = 1 } @@ -2355,7 +2355,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_auto_scaling = true min_count = 1 max_count = 399 @@ -2375,7 +2375,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_auto_scaling = true min_count = 1 max_count = 1 @@ -2395,7 +2395,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 3 fips_enabled = true kubelet_disk_type = "OS" @@ -2561,7 +2561,7 @@ provider "azurerm" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_auto_scaling = %t min_count = %d max_count = %d @@ -2904,7 +2904,7 @@ data "azurerm_kubernetes_node_pool_snapshot" "test" { resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "new" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 snapshot_id = data.azurerm_kubernetes_node_pool_snapshot.test.id depends_on = [ @@ -2999,7 +2999,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" vnet_subnet_id = azurerm_subnet.test["6"].id pod_subnet_id = azurerm_subnet.test["7"].id upgrade_settings { diff --git a/internal/services/containers/kubernetes_cluster_other_resource_test.go b/internal/services/containers/kubernetes_cluster_other_resource_test.go index 9e993d452276a..ea63581b7a7eb 100644 --- a/internal/services/containers/kubernetes_cluster_other_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_other_resource_test.go @@ -1208,7 +1208,7 @@ resource "azurerm_kubernetes_cluster" "test" { name = "default" node_count = 1 type = "AvailabilitySet" - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1242,7 +1242,7 @@ resource "azurerm_kubernetes_cluster" "test" { name = "default" node_count = 1 enable_auto_scaling = true - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" min_count = 1 max_count = 1 upgrade_settings { @@ -1277,7 +1277,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 2 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_auto_scaling = true max_count = 10 min_count = 1 @@ -1313,7 +1313,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_auto_scaling = true max_count = 10 min_count = 1 @@ -1349,7 +1349,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 11 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_auto_scaling = true max_count = 10 min_count = 1 @@ -1384,7 +1384,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_auto_scaling = true min_count = 1 max_count = 399 @@ -1421,7 +1421,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_auto_scaling = true max_count = 10 min_count = 2 @@ -1457,7 +1457,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1483,7 +1483,7 @@ resource "azurerm_kubernetes_cluster" "import" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1517,7 +1517,7 @@ resource "azurerm_kubernetes_cluster" "test" { name = "default" node_count = 1 type = "AvailabilitySet" - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" only_critical_addons_enabled = true upgrade_settings { max_surge = "10%%" @@ -1551,7 +1551,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" temporary_name_for_rotation = "temp" upgrade_settings { max_surge = "10%%" @@ -1635,7 +1635,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" temporary_name_for_rotation = "temp" upgrade_settings { max_surge = "10%%" @@ -1693,7 +1693,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1727,7 +1727,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1764,7 +1764,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1797,7 +1797,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" fips_enabled = true kubelet_disk_type = "OS" message_of_the_day = "daily message" @@ -1871,7 +1871,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1929,7 +1929,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" pod_subnet_id = azurerm_subnet.podsubnet.id vnet_subnet_id = azurerm_subnet.nodesubnet.id upgrade_settings { @@ -1966,7 +1966,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1999,7 +1999,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2036,7 +2036,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2082,7 +2082,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2133,7 +2133,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "np" node_count = 3 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2188,7 +2188,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "np" node_count = 3 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2316,7 +2316,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "np" node_count = 3 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2371,7 +2371,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 upgrade_settings { max_surge = "10%%" @@ -2405,7 +2405,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 upgrade_settings { max_surge = "10%%" @@ -2438,7 +2438,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2477,7 +2477,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2514,7 +2514,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2621,7 +2621,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2672,7 +2672,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2731,7 +2731,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2816,7 +2816,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" scale_down_mode = "%s" upgrade_settings { max_surge = "10%%" @@ -2847,7 +2847,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -2987,7 +2987,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -3026,7 +3026,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -3063,7 +3063,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -3105,7 +3105,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -3147,7 +3147,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -3185,7 +3185,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -3252,7 +3252,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -3288,7 +3288,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -3326,7 +3326,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -3357,7 +3357,7 @@ resource "azurerm_kubernetes_cluster" "test" { node_os_channel_upgrade = "%s" default_node_pool { name = "default" - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 upgrade_settings { max_surge = "10%%" @@ -3385,7 +3385,7 @@ resource "azurerm_kubernetes_cluster" "test" { node_os_upgrade_channel = "%s" default_node_pool { name = "default" - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 upgrade_settings { max_surge = "10%%" @@ -3423,7 +3423,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -3455,7 +3455,7 @@ resource "azurerm_kubernetes_cluster" "source" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -3486,7 +3486,7 @@ resource "azurerm_kubernetes_cluster" "source" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -3509,7 +3509,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" snapshot_id = data.azurerm_kubernetes_node_pool_snapshot.test.id upgrade_settings { max_surge = "10%%" @@ -3575,7 +3575,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 upgrade_settings { max_surge = "10%%" @@ -3607,7 +3607,7 @@ resource "azurerm_kubernetes_cluster" "test" { dns_prefix = "acctestaks%[2]d" default_node_pool { name = "default" - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 upgrade_settings { max_surge = "10%%" @@ -3640,7 +3640,7 @@ resource "azurerm_kubernetes_cluster" "test" { dns_prefix = "acctestaks%[2]d" default_node_pool { name = "default" - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 upgrade_settings { max_surge = "10%%" diff --git a/internal/services/containers/kubernetes_cluster_resource.go b/internal/services/containers/kubernetes_cluster_resource.go index f97b3fa44b3c2..af4a3ed786bd0 100644 --- a/internal/services/containers/kubernetes_cluster_resource.go +++ b/internal/services/containers/kubernetes_cluster_resource.go @@ -111,9 +111,6 @@ func resourceKubernetesCluster() *pluginsdk.Resource { pluginsdk.ForceNewIfChange("network_profile.0.network_plugin_mode", func(ctx context.Context, _, new, meta interface{}) bool { return !strings.EqualFold(new.(string), string(managedclusters.NetworkPluginModeOverlay)) }), - pluginsdk.ForceNewIfChange("network_profile.0.network_policy", func(ctx context.Context, old, new, meta interface{}) bool { - return old.(string) != "" || new.(string) != string(managedclusters.NetworkPolicyCilium) - }), pluginsdk.ForceNewIfChange("custom_ca_trust_certificates_base64", func(ctx context.Context, old, new, meta interface{}) bool { return len(old.([]interface{})) > 0 && len(new.([]interface{})) == 0 }), @@ -2310,6 +2307,11 @@ func resourceKubernetesClusterUpdate(d *pluginsdk.ResourceData, meta interface{} existing.Model.Properties.NetworkProfile.NetworkDataplane = pointer.To(managedclusters.NetworkDataplane(ebpfDataPlane)) } + if key := "network_profile.0.network_policy"; d.HasChange(key) { + networkPolicy := d.Get(key).(string) + existing.Model.Properties.NetworkProfile.NetworkPolicy = pointer.To(managedclusters.NetworkPolicy(networkPolicy)) + } + if key := "network_profile.0.outbound_type"; d.HasChange(key) { outboundType := managedclusters.OutboundType(d.Get(key).(string)) existing.Model.Properties.NetworkProfile.OutboundType = pointer.To(outboundType) diff --git a/internal/services/containers/kubernetes_cluster_resource_test.go b/internal/services/containers/kubernetes_cluster_resource_test.go index 4cc780aaf0332..bee681cfe6d55 100644 --- a/internal/services/containers/kubernetes_cluster_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_resource_test.go @@ -320,7 +320,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_host_encryption = true upgrade_settings { max_surge = "10%%" @@ -475,7 +475,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = %q } @@ -584,7 +584,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -622,7 +622,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -660,7 +660,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -697,7 +697,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -751,7 +751,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -835,7 +835,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -871,7 +871,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -913,7 +913,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } diff --git a/internal/services/containers/kubernetes_cluster_resource_upgrade_test.go b/internal/services/containers/kubernetes_cluster_resource_upgrade_test.go index 413df6ad9f7e2..d0eb0051e732e 100644 --- a/internal/services/containers/kubernetes_cluster_resource_upgrade_test.go +++ b/internal/services/containers/kubernetes_cluster_resource_upgrade_test.go @@ -315,7 +315,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" drain_timeout_in_minutes = %d @@ -351,7 +351,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -385,7 +385,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" orchestrator_version = %q upgrade_settings { max_surge = "10%%" @@ -406,7 +406,7 @@ func (r KubernetesClusterResource) upgradeVersionsConfig(data acceptance.TestDat resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 orchestrator_version = %q } @@ -420,7 +420,7 @@ func (r KubernetesClusterResource) upgradeVersionsConfigSpot(data acceptance.Tes resource "azurerm_kubernetes_cluster_node_pool" "test" { name = "internal" kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" node_count = 1 orchestrator_version = %q priority = "Spot" @@ -456,7 +456,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_auto_scaling = true min_count = %d max_count = %d diff --git a/internal/services/containers/kubernetes_cluster_scaling_resource_test.go b/internal/services/containers/kubernetes_cluster_scaling_resource_test.go index 782ba4df4df29..ef91b982da30c 100644 --- a/internal/services/containers/kubernetes_cluster_scaling_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_scaling_resource_test.go @@ -488,7 +488,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -526,7 +526,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" enable_host_encryption = true upgrade_settings { max_surge = "10%%" @@ -604,7 +604,7 @@ resource "azurerm_kubernetes_cluster" "test" { name = "default" temporary_name_for_rotation = "temp" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -789,7 +789,7 @@ resource "azurerm_kubernetes_cluster" "test" { fips_enabled = true name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -918,7 +918,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = %d - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -956,7 +956,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -995,7 +995,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" tags = { Hello = "World" @@ -1040,7 +1040,7 @@ resource "azurerm_kubernetes_cluster" "test" { enable_auto_scaling = true min_count = 2 max_count = 4 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1075,7 +1075,7 @@ resource "azurerm_kubernetes_cluster" "test" { min_count = 1 max_count = 2 enable_auto_scaling = true - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1111,7 +1111,7 @@ resource "azurerm_kubernetes_cluster" "test" { min_count = 1 max_count = 2 enable_auto_scaling = true - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" zones = ["1", "2"] upgrade_settings { max_surge = "10%%" @@ -1152,7 +1152,7 @@ resource "azurerm_kubernetes_cluster" "test" { enable_auto_scaling = true min_count = 2 max_count = 4 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } @@ -1192,7 +1192,7 @@ resource "azurerm_kubernetes_cluster" "test" { enable_auto_scaling = true min_count = 2 max_count = 4 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } diff --git a/internal/services/containers/kubernetes_cluster_trusted_access_role_binding_resource_gen_test.go b/internal/services/containers/kubernetes_cluster_trusted_access_role_binding_resource_gen_test.go index b2adaa8f240b3..140b939f8d3e6 100644 --- a/internal/services/containers/kubernetes_cluster_trusted_access_role_binding_resource_gen_test.go +++ b/internal/services/containers/kubernetes_cluster_trusted_access_role_binding_resource_gen_test.go @@ -147,7 +147,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } diff --git a/internal/services/containers/kubernetes_fleet_member_resource_gen_test.go b/internal/services/containers/kubernetes_fleet_member_resource_gen_test.go index f36e30f9b6754..30d142f3ea521 100644 --- a/internal/services/containers/kubernetes_fleet_member_resource_gen_test.go +++ b/internal/services/containers/kubernetes_fleet_member_resource_gen_test.go @@ -170,7 +170,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" } diff --git a/internal/services/containers/kubernetes_fleet_update_run_resource_test.go b/internal/services/containers/kubernetes_fleet_update_run_resource_test.go index aef52915d8ff9..4b4cab7eeb880 100644 --- a/internal/services/containers/kubernetes_fleet_update_run_resource_test.go +++ b/internal/services/containers/kubernetes_fleet_update_run_resource_test.go @@ -202,7 +202,7 @@ resource "azurerm_kubernetes_cluster" "test" { default_node_pool { name = "default" node_count = 1 - vm_size = "Standard_DS2_v2" + vm_size = "Standard_D2s_v5" upgrade_settings { max_surge = "10%%" }