Terraform v0.11.7
+ provider.azurerm v1.17.0
The resource does not report any change when terraform apply is executed without any change a second time.
When creating the kubernetes cluster and apply again, some attributes will be reported as changed and therefore cause a cluster recreation:
agent_pool_profile.0.os_disk_size_gb:       "30" => "0" (forces new resource)
terraform apply again.The obvious workaround is to ignore changes in the reported changed fields.
  lifecycle {
    ignore_changes = ["agent_pool_profile"]
  }
Same issue for me. Once the cluster has been recreated I'm getting following error
* azurerm_kubernetes_cluster.cluster: containerservice.ManagedClustersClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InvalidParameter" Message="The value of parameter orchestratorProfile.OrchestratorVersion is invalid." Target="orchestratorProfile.OrchestratorVersion"
Practically the cluster is broken after the recreation so this is a very critical issue to me!
btw. I don't think it's related to the version as I've faced with 1.13.0 the same issues. Maybe there has something changed in the Azure API...
@subesokun I think we're seeing two issues here. Cluster creation and recreation is fine for me for a kubernetes 1.11.3 cluster. I definitely only did upgrade the terraform plugin since yesterday. An azure API change would be quite a coincidence, but I can try to verify by downgrading the terraform plugin.
The error message you describe was already posted here: https://github.com/Azure/AKS/issues/103
Hi @kautsig,
Thanks for opening this issue. Looking into it I can confirm that this is a result of an API change and will affect recent version of the provider. Currently if os_disk_size_gb is not specified, we send 0 to the API, it uses a default of 30, and still returns 0. Now the API is returning 30 causing terraform to think a change is required.
I hopefully will have a fix ready later today, for now aside from ignoring lifecycle changes you should be able to simply set os_disk_size_gb to 30.
@katbyte thanks for your response. I applied the suggested workaround to simply set the default value, it's definitely the better one.
I re-tried with a simpler example, now the 2 mentioned other attributes are also not affected. I adjusted the issue text to reflect that.
Hey @subesokun,
it seems my coworker stumbled across the issue you posted, which is indeed not related to the API change which was fixed in this PR.
To me it seems that azure removed a supported k8s versions from their API. We had a 1.10.5 cluster in westeurope, but az aks get-versions --location westeurope -o table doesn't list this version any more.
I'd guess this could lead to the validation error you posted, because orchestratorVersion is the k8s version in acs-engine. Hope this helps.
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 👉 [email protected]. Thanks!
Most helpful comment
Hey @subesokun,
it seems my coworker stumbled across the issue you posted, which is indeed not related to the API change which was fixed in this PR.
To me it seems that azure removed a supported k8s versions from their API. We had a
1.10.5cluster in westeurope, butaz aks get-versions --location westeurope -o tabledoesn't list this version any more.I'd guess this could lead to the validation error you posted, because orchestratorVersion is the k8s version in acs-engine. Hope this helps.