Describe the bug
Cannot create a WINDOWS node pool using Terraform. Can create using Portal GUI or az-cli using same parameters.
To Reproduce
Steps to reproduce the behavior:
Setup pipeline as (include yaml configuration or screenshots of classic ui editor)
resource "azurerm_kubernetes_cluster_node_pool" "winxxx" {
availability_zones = [1, 2, 3]
enable_auto_scaling = true
kubernetes_cluster_id = azurerm_kubernetes_cluster.aks_cluster.id
max_count = 3
min_count = 1
mode = "User"
name = "win01"
orchestrator_version = data.azurerm_kubernetes_service_versions.current.latest_version
os_disk_size_gb = 128
os_type = "Windows" # Default is Linux, we can change to Windows
vm_size = "Standard_D2s_v3"
priority = "Regular" # Default is Regular, we can change to Spot with additional settings like eviction_policy, spot_max_price, node_labels and node_taints
node_labels = {
"nodepool-type" = "user"
"environment" = var.environment
"nodepoolos" = "windows"
"app" = "dotnet-apps"
}
tags = {
"nodepool-type" = "user"
"environment" = var.environment
"nodepoolos" = "windows"
"app" = "dotnet-apps"
}
}
Execute pipeline
See error
/usr/local/bin/terraform apply -auto-approve /home/vsts/work/1/terraform-manifests-out/test-27.out
azurerm_kubernetes_cluster_node_pool.winxxx: Creating...
Error: creating/updating Managed Kubernetes Cluster Node Pool "win01" (Resource Group "terraform-aks-test"): containerservice.AgentPoolsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="InvalidOSSKU" Message="OSSKU='Ubuntu' is invalid, details: Windows does not allow OSSKU selection"
│ with azurerm_kubernetes_cluster_node_pool.winxxx,
│ on 10-aks-cluster-windows-user-nodepools.tf line 3, in resource "azurerm_kubernetes_cluster_node_pool" "winxxx":
│ 3: resource "azurerm_kubernetes_cluster_node_pool" "winxxx" {
[error]Terraform command 'apply' failed with exit code '1'.
[error]╷
│ Error: creating/updating Managed Kubernetes Cluster Node Pool "win01" (Resource Group "terraform-aks-test"): containerservice.AgentPoolsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="InvalidOSSKU" Message="OSSKU='Ubuntu' is invalid, details: Windows does not allow OSSKU selection"
│
│ with azurerm_kubernetes_cluster_node_pool.winxxx,
│ on 10-aks-cluster-windows-user-nodepools.tf line 3, in resource "azurerm_kubernetes_cluster_node_pool" "winxxx":
│ 3: resource "azurerm_kubernetes_cluster_node_pool" "winxxx" {
Finishing: Terraform Apply
Expected behavior
A clear and concise description of what you expected to happen.
should have created a windows node pool with 1 node
Screenshots
If applicable, add screenshots to help explain your problem.
Pipeline Logs
Include logs that help demonstrate the problem. Please make sure to redact any sensitive info such as secrets.
Agent Configuration
OS: ubuntu
Hosted in Azure DevOps
Terraform version used (Default for hosted agent is acceptable). 1.0.6
AzureCLI version used (Default for hosted agent is acceptable or N/A)
the class was record some time after 11/4/20 so this appears to have been functional in an
earlier version of the plugin OR an earlier version of Terraform
This appears to be an issue with terraform itself (most likely the way the templates are configured) rather than this task. I would suggest directing your question to the azurerm terraform provider.
Describe the bug Cannot create a WINDOWS node pool using Terraform. Can create using Portal GUI or az-cli using same parameters.
To Reproduce Steps to reproduce the behavior:
resource "azurerm_kubernetes_cluster_node_pool" "winxxx" { availability_zones = [1, 2, 3] enable_auto_scaling = true kubernetes_cluster_id = azurerm_kubernetes_cluster.aks_cluster.id max_count = 3 min_count = 1 mode = "User" name = "win01" orchestrator_version = data.azurerm_kubernetes_service_versions.current.latest_version os_disk_size_gb = 128 os_type = "Windows" # Default is Linux, we can change to Windows vm_size = "Standard_D2s_v3" priority = "Regular" # Default is Regular, we can change to Spot with additional settings like eviction_policy, spot_max_price, node_labels and node_taints node_labels = { "nodepool-type" = "user" "environment" = var.environment "nodepoolos" = "windows" "app" = "dotnet-apps" } tags = { "nodepool-type" = "user" "environment" = var.environment "nodepoolos" = "windows" "app" = "dotnet-apps" } }
Execute pipeline
See error
/usr/local/bin/terraform apply -auto-approve /home/vsts/work/1/terraform-manifests-out/test-27.out azurerm_kubernetes_cluster_node_pool.winxxx: Creating... Error: creating/updating Managed Kubernetes Cluster Node Pool "win01" (Resource Group "terraform-aks-test"): containerservice.AgentPoolsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="InvalidOSSKU" Message="OSSKU='Ubuntu' is invalid, details: Windows does not allow OSSKU selection" │ with azurerm_kubernetes_cluster_node_pool.winxxx, │ on 10-aks-cluster-windows-user-nodepools.tf line 3, in resource "azurerm_kubernetes_cluster_node_pool" "winxxx": │ 3: resource "azurerm_kubernetes_cluster_node_pool" "winxxx" {
[error]Terraform command 'apply' failed with exit code '1'.
[error]╷
│ Error: creating/updating Managed Kubernetes Cluster Node Pool "win01" (Resource Group "terraform-aks-test"): containerservice.AgentPoolsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="InvalidOSSKU" Message="OSSKU='Ubuntu' is invalid, details: Windows does not allow OSSKU selection" │ │ with azurerm_kubernetes_cluster_node_pool.winxxx, │ on 10-aks-cluster-windows-user-nodepools.tf line 3, in resource "azurerm_kubernetes_cluster_node_pool" "winxxx": │ 3: resource "azurerm_kubernetes_cluster_node_pool" "winxxx" {
Finishing: Terraform Apply
Expected behavior A clear and concise description of what you expected to happen. should have created a windows node pool with 1 node
Screenshots If applicable, add screenshots to help explain your problem.
Pipeline Logs Include logs that help demonstrate the problem. Please make sure to redact any sensitive info such as secrets.
Agent Configuration
Additional context Add any other context about the problem here. this is a class example: from https://www.udemy.com/course/azure-kubernetes-service-with-azure-devops-and-terraform/learn/lecture/23644074 at 4:28
the class was record some time after 11/4/20 so this appears to have been functional in an earlier version of the plugin OR an earlier version of Terraform
azurerm.log