Closed luc1f4 closed 4 years ago
I can confirm, that creating AKS cluster and then trying to add tags to it currently fails with mentioned error message. However, the issue title is misleading, as there are changes planned to AKS resource.
The same thing actually happens, when you try changing Kubernetes version, where the same change works just fine via Azure CLI.
I extracted the code from the provider to apply simple AKS updates and they seem to work, so something in provider implementation must be breaking it: https://gist.github.com/invidian/c20df813df64df0ce0ddb0d68df79b53
Added some debug messages and it seems that expandKubernetesClusterAgentPoolProfiles is currently mutating the pools and that's why the update is rejected:
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: AgentPoolProfiles:
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: 0:
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: Name: default
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: Count: 2
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: VMSize: Standard_D1_v2
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: OsDiskSizeGB: 30
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: VnetSubnetID: /subscriptions/s/resourceGroups/sproviders/Microsoft.Network/virtualNetworks/s/subnets/s
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: MaxPods: 110
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: OsType: Linux
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: MaxCount: 5
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: MinCount: 2
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: EnableAutoScaling: true
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: Type: VirtualMachineScaleSets
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: OrchestratorVersion: 1.14.6
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: ProvisioningState: Succeeded
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: EnableNodePublicIP: false
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: ScaleSetPriority:
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: ScaleSetEvictionPolicy:
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: New AgentPoolProfiles:
2019-09-05T11:04:45.017+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: 0:
2019-09-05T11:04:45.018+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: Name: default
2019-09-05T11:04:45.018+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: VMSize: Standard_D1_v2
2019-09-05T11:04:45.018+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: OsDiskSizeGB: 30
2019-09-05T11:04:45.018+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: VnetSubnetID: /subscriptions/s/resourceGroups/s/providers/Microsoft.Network/virtualNetworks/s/subnets/s
2019-09-05T11:04:45.018+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: MaxPods: 110
2019-09-05T11:04:45.018+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: OsType: Linux
2019-09-05T11:04:45.018+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: MaxCount: 5
2019-09-05T11:04:45.018+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: MinCount: 2
2019-09-05T11:04:45.018+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: EnableAutoScaling: true
2019-09-05T11:04:45.018+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: Type: VirtualMachineScaleSets
2019-09-05T11:04:45.018+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: ScaleSetPriority:
2019-09-05T11:04:45.018+0200 [DEBUG] plugin.terraform-provider-azurerm_v1.33.1_x4: ScaleSetEvictionPolicy:
Created PR with fixes for it #4256 :)
Any updates?
Is there a workaround until this is merged and released? I really don't want to recreate my cluster.
When will be all the related fixes checked in? Is there any workaround before the code fix is made?
Hi, I think I'm still affected by this issue⦠is it merged to the master Branch? which AzureRM version should I use?
Thanks,
This has been released in version 1.37.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:
provider "azurerm" {
version = "~> 1.37.0"
}
# ... other configuration ...
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error π€ π , please reach out to my human friends π hashibot-feedback@hashicorp.com. Thanks!
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_kubernetes_cluster
Terraform Configuration Files
Terraform Plan Output
Panic Output
Expected Behavior
As the terraform plan suggested no changes (only changes in the tags), the azurerm_kubernetes_cluster ressource should be stay untouched
Actual Behavior
Steps to Reproduce
terraform plan --out tfplan
terraform apply tfplan