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

Support for changing VM Size on node pool #21859

Closed
1 task done
SOFSPEEL opened this issue May 19, 2023 · 3 comments
Closed
1 task done

Support for changing VM Size on node pool #21859

SOFSPEEL opened this issue May 19, 2023 · 3 comments

Comments

@SOFSPEEL
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

It would be nice to be able to resize vm's on azurerm_kubernetes_cluster_node_pool https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster_node_pool using the same temporary_name_for_rotation technique to the way they are resized on the Default Node Pool here: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster#temporary_name_for_rotation

New or Affected Resource(s)/Data Source(s)

azurerm_kubernetes_cluster_node_pool

Potential Terraform Configuration

resource "azurerm_kubernetes_cluster_node_pool" "aks" {
  lifecycle {
    ignore_changes = [
      node_count
    ]
  }
  kubernetes_cluster_id = azurerm_kubernetes_cluster.aks.id
  name                  = "appspool1"
  node_count            = module.settings.aks_agent_count
  vm_size               = module.settings.aks_apps_pool_vm_size
  temporary_name_for_rotation = "temppool"
  os_disk_size_gb       = module.settings.aks_agent_os_disk_size
  vnet_subnet_id        = data.azurerm_subnet.subnet.id
  enable_auto_scaling   = module.settings.aks_agent_auto_scaling_enable
  min_count             = module.settings.aks_agent_min_count
  max_count             = module.settings.aks_agent_max_count
  node_labels = {
    "nodepool-type" = "user"
    "nodepoolos"    = "linux"
    "app"           = "aspnetcore"
  }
}

References

No response

@SOFSPEEL SOFSPEEL changed the title Support for temporary_name_for_rotation on azurerm_kubernetes_cluster_node_pool Support for changing VM Size on node pool May 19, 2023
@ms-henglu
Copy link
Contributor

ms-henglu commented May 22, 2023

Hi @SOFSPEEL ,

Thank you for taking time to open this issue.

It seems the API doesn't support this feature.

And unfortunately, the temporary_name_for_rotation technique is not applicable in the node pool resizing. Because when default node pool's vmsize changes, azurerm provider creates a temporary default node pool, then delete the old default node pool, then create the new default node pool with new vm size, and remove the temporary node pool. It seems that the behavior is very similar to what happens when node pool's vm size changes and forces it to re-create.

I'm not sure whether this create_before_destroy = true meta-argument can help in this case: https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#create_before_destroy
Because it changes this behavior so that new replacement object is created first, and the prior object is destroyed after the replacement is created.

@stephybun
Copy link
Member

Thanks for raising this issue @SOFSPEEL - another request for this just came in with a more generic title. So that we don't have multiple issues tracking the same thing I'm going to close this issue in favour of #22265. Please subscribe to #22265 for updates.

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 May 25, 2024
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

4 participants