Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Version 2.76.0 azurerm_kubernetes_cluster_node_pool adds by default a os_sku = "Ubuntu" when I deploy a windows node and it fails #13306

Closed
jm01 opened this issue Sep 10, 2021 · 7 comments

Comments

@jm01
Copy link

jm01 commented Sep 10, 2021

The new version 2.76.0 adds a os_sku = "Ubuntu" when I deploy a windows node. Thus, it fails

Error: creating/updating Managed Kubernetes Cluster Node Pool "uwinnd" (Resource Group "z0euw1dcmrsg002"): containerservice.AgentPoolsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="InvalidOSSKU" Message="OSSKU='Ubuntu' is invalid, details: Windows does not allow OSSKU selection"

The plan:

azurerm_kubernetes_cluster_node_pool.nodes["1"] will be created

  • resource "azurerm_kubernetes_cluster_node_pool" "nodes" {
    • availability_zones = [
      • "1",
      • "2",
        ]
    • enable_auto_scaling = true
    • id = (known after apply)
    • kubelet_disk_type = (known after apply)
    • kubernetes_cluster_id = "/subscriptions/54f6184f-874c-4082-b79a-269f5641cd1c/resourcegroups/z0euw1dcmrsg002/providers/Microsoft.ContainerService/managedClusters/caasplatform01dakspltfrm"
    • max_count = 5
    • max_pods = (known after apply)
    • min_count = 2
    • mode = "User"
    • name = "uwinnd"
    • node_count = 5
    • node_labels = (known after apply)
    • orchestrator_version = (known after apply)
    • os_disk_size_gb = (known after apply)
    • os_disk_type = "Managed"
    • os_sku = "Ubuntu"
    • os_type = "Windows"
    • priority = "Regular"
    • spot_max_price = -1
    • ultra_ssd_enabled = false
    • vm_size = "Standard_D4s_v3"
    • vnet_subnet_id = "/subscriptions/54f6184f-874c-4082-b79a-269f5641cd1c/resourceGroups/z0euw1dcmrsg002/providers/Microsoft.Network/virtualNetworks/caasplatform01daksplatformvn/subnets/caasplatform01daksplatformkubesubnet"
      }

My Script


locals {
node_pools = [
{
name = "ulnxnd"
node_count = var.aks_agent_count_linuxuser
vm_size = var.aks_agent_vm_size_linuxuser
type = "VirtualMachineScaleSets"
availability_zones = ["1", "2"]
enable_auto_scaling = true
min_count = var.min_count_linuxuser
max_count = var.max_count_linuxuser
mode = "User"
os_type = "Linux"
},
{
name = "uwinnd"
node_count = var.aks_agent_count_windowsuser
vm_size = var.aks_agent_vm_size_windowsuser
type = "VirtualMachineScaleSets"
availability_zones = ["1", "2"]
enable_auto_scaling = true
min_count = var.min_count_windowsuser
max_count = var.max_count_windowsuser
vnet_subnet_id = azurerm_subnet.kubesubnet.id
mode = "User"
os_type = "Windows"
}
]
}

resource "azurerm_kubernetes_cluster_node_pool" "nodes" {
lifecycle {
ignore_changes = [
node_count
]
}
for_each = {
for index, node in local.node_pools:
index => node }
name = "${each.value.name}"
kubernetes_cluster_id = azurerm_kubernetes_cluster.cluster.id
node_count = each.value.node_count
vm_size = each.value.vm_size
availability_zones = each.value.availability_zones
enable_auto_scaling = each.value.enable_auto_scaling
min_count = each.value.min_count
max_count = each.value.max_count
vnet_subnet_id = azurerm_subnet.kubesubnet.id
mode = each.value.mode
os_type = each.value.os_type

}


@f35f0ef9d0e827dae86552d3899f78fc

Linking to related feature-add: #13284

@smark88
Copy link

smark88 commented Sep 14, 2021

This will also force a cluster rebuild when set even tho nothing is changing. We default to Ubuntu and now its setting

+ os_sku                       = "Ubuntu" # forces replacement

and wanting to force all our clusters to rebuild.

@mbfrahry mbfrahry added this to the v2.77.0 milestone Sep 14, 2021
@BertelBB
Copy link

This will also force a cluster rebuild when set even tho nothing is changing. We default to Ubuntu and now its setting

+ os_sku                       = "Ubuntu" # forces replacement

and wanting to force all our clusters to rebuild.

Exactly! It is also marked as Optional which it clearly is not

@katbyte katbyte modified the milestones: v2.77.0, v2.78.0 Sep 17, 2021
@aristosvo
Copy link
Collaborator

@katbyte this seems to be already fixed by #13321, which is released in 2.77.0

@katbyte katbyte modified the milestones: v2.78.0, v2.79.0 Sep 24, 2021
@katbyte katbyte modified the milestones: v2.79.0, v2.80.0 Oct 1, 2021
@katbyte katbyte modified the milestones: v2.80.0, v2.81.0, v2.82.0 Oct 8, 2021
@katbyte katbyte modified the milestones: v2.82.0, v2.83.0 Oct 21, 2021
@github-actions
Copy link

This functionality has been released in v2.83.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@katbyte katbyte modified the milestones: v2.83.0, v2.84.0 Oct 29, 2021
@katbyte katbyte modified the milestones: v2.84.0, v2.85.0, v2.86.0 Nov 5, 2021
@katbyte katbyte removed this from the v2.86.0 milestone Nov 19, 2021
@katbyte katbyte added this to the v2.87.0 milestone Nov 19, 2021
@stephybun stephybun modified the milestones: v2.87.0, v2.77.0 Nov 23, 2021
@stephybun
Copy link
Member

stephybun commented Nov 23, 2021

As pointed out in this comment this issue has been resolved and the fix released in v2.77.0.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants