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 current_kubernetes_version on azurerm_kubernetes_cluster resource #22993

Closed
1 task done
stevehipwell opened this issue Aug 17, 2023 · 4 comments · Fixed by #25079
Closed
1 task done

Support for current_kubernetes_version on azurerm_kubernetes_cluster resource #22993

stevehipwell opened this issue Aug 17, 2023 · 4 comments · Fixed by #25079

Comments

@stevehipwell
Copy link

stevehipwell commented Aug 17, 2023

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 and review the contribution guide to help.

Description

I'd like to be able to get the current Kubernetes version from an azurerm_kubernetes_cluster resource. This information would be generally useful for reporting purposes and advanced automation use cases.

This change would also allow us to work around a current AKS bug with alias expansion for node pools (which we can't work around with the AKS suggested fix due to how the provider deals with setting the orchestrator version empty). We're currently having to use a shell script to get this value.

This data is already available in the provider and would only need to be exposed on the resource.

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

azurerm_kubernetes_cluster

Potential Terraform Configuration

resource "azurerm_kubernetes_cluster" "default" {
  name               = "test"
  kubernetes_version = "1.27"
}

resource "azurerm_kubernetes_cluster_node_pool" "default" {
  name                  = "test"
  kubernetes_cluster_id = azurerm_kubernetes_cluster.default.id
  orchestrator_version  = azurerm_kubernetes_cluster.default.current_kubernetes_version
}

References

@stevehipwell stevehipwell changed the title Support for current_kubernetes_version on azurerm_kubernetes_cluster Support for current_kubernetes_version on azurerm_kubernetes_cluster resource Aug 18, 2023
@pszypowicz
Copy link

pszypowicz commented Dec 15, 2023

Hello,

Any updates? This is really missing at the moment in the provider.

@steph409
Copy link
Contributor

Hi,
there is an attribute kubernetes_version instead of current_kubernetes_version on the azurerm_kubernetes_cluster resource. Why are you not using this one instead:

resource "azurerm_kubernetes_cluster" "default" {
  name               = "test"
  kubernetes_version = "1.27"
}

resource "azurerm_kubernetes_cluster_node_pool" "default" {
  name                  = "test"
  kubernetes_cluster_id = azurerm_kubernetes_cluster.default.id
  orchestrator_version  = azurerm_kubernetes_cluster.default.kubernetes_version
}

@stevehipwell
Copy link
Author

@steph409 there are two versions associated with an AKS cluster. This is reflected in the data source but not the resource.

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 Apr 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants