Closed cippaciong closed 1 year ago
Hello. Just a quick update related to this issue.
Since I couldn't find the reason why the upgrade was not working, I ended up doing it manually from the Azure UI.
After the first upgrade from v1.24
to v1.25
was successful, I tried to do the next ones (up to v1.27
) using Terraform and they worked fine. I just set both kubernetes_version
and default_node_pool.orchestrator_version
to the version that I wanted to upgrade to, as expected.
I'm closing the issue since it's clearly not a problem with the provider, but rather with the Azure API or due to a broken state of the cluster that was solved after the first upgrade.
If others have this issue in the future, they might consider doing the update using the UI first and then try again with terraform 🤷🏻
@cippaciong see my comment here: https://github.com/Azure/AKS/issues/3508#issuecomment-1568518512
@BertelBB I think I stumbled upon your comment while I was trying to debug my issue, but your scenario is not exactly the same as mine, although very similar.
Most of the time, the NotAllAgentPoolOrchestratorVersionSpecifiedAndUnchanged
error appears when automatic_channel_upgrade
is enabled. In that case, your comment is 100% correct. As I saw from the trace logs, Terraform is sending two different values for kubernetes_version
and default_node_pool.orchestrator_version
, which is not supported by the API.
In my case though, I never enabled automatic_channel_upgrade
and according to the docs it should be possible to do the two-step upgrade as Terraform is trying to do.
Or at least that's my interpretation of this section:
If you’re using cluster auto-upgrade, you can no longer upgrade the control plane first, and then upgrade the individual node pools. Cluster auto-upgrade always upgrades the control plane and the node pools together. You can't upgrade the control plane only. Running the az aks upgrade --control-plane-only command raises the following error: NotAllAgentPoolOrchestratorVersionSpecifiedAndUnchanged: Using managed cluster api, all Agent pools' OrchestratorVersion must be all specified or all unspecified. If all specified, they must be stay unchanged or the same with control plane.
Facing the same issue when upgrading from 1.26.3 to 1.27.7 where I too didn't set automatic_channel_upgrade
we are suddenly seeing the same issue in an AKS cluster that was first at the 1.28 preview version and then auto-upgraded to 1.28.3 upon release. I tried hardcoding the version in terraform and reapplying but that has no effect ![Uploading image.png…]()
Same here while upgrading from 1.28 version and 1.28.3 version we are getting this error.
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.
Is there an existing issue for this?
Community Note
Terraform Version
v1.5.7
AzureRM Provider Version
v3.75.0
Affected Resource(s)/Data Source(s)
azurerm_kubernetes_cluster
Terraform Configuration Files
Debug Output/Panic Output
https://gist.github.com/cippaciong/a603d3641b2945658032a7a9a1ba8d08
Expected Behaviour
Terraform/AKS would upgrade the cluster and the node pool from the current version (v1.24) to the new version (v1.25)
Actual Behaviour
The upgrade fails with the following error
According to the docs, this error should occur only when auto-upgrade is enabled, but this is not the case (link)
Steps to Reproduce
With the provided configuration, trying to upgrade Kubernetes from v1.24 to v1.25:
var.k8s_version
to1.25
var.node_pool_orchestrator_version
to1.25
, or keep it to1.24
for a two-step upgrade, or comment theorchestrator_version
parameter.terraform apply
Important Factoids
Running
terraform
throughterragrunt
References
Possibly related issues or PRs: