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

"azurerm_kubernetes_cluster" - supports "max_node_provisioning_time","max_unready_percentage" and "max_unready_nodes" #11406

Merged

Conversation

njuCZ
Copy link
Contributor

@njuCZ njuCZ commented Apr 21, 2021

This PR adds support for the max_node_provision_time, max_total_unready_percentage and ok_total_unready_count property in the auto_scaler_profile block for azurerm_kubernetes_cluster.

As per https://docs.microsoft.com/en-us/azure/aks/cluster-autoscaler#using-the-autoscaler-profile

the original acctest TestAccKubernetesCluster_autoScalingProfile fails because the version "1.19.6" is not available in the westeurope
image

…x_total_unready_percentage" and "ok_total_unready_count"
@njuCZ njuCZ closed this Apr 21, 2021
@njuCZ njuCZ reopened this Apr 21, 2021
Copy link
Collaborator

@magodo magodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR!
I've taken a look through and left some comments inline, but this is mostly looking good to me 👍

@ghost ghost added size/M and removed size/S labels Apr 22, 2021
@njuCZ njuCZ requested a review from magodo April 22, 2021 08:56
@magodo
Copy link
Collaborator

magodo commented Apr 22, 2021

LGTM 👍
image

@magodo
Copy link
Collaborator

magodo commented Apr 23, 2021

@njuCZ About the default values, I'm a bit concerned if some existing resource has different default values being set when they created the resource with old provider, then they'll get a diff in the new provider. Though this is not likely to happen if the service keeps the behavior consistent.

@njuCZ
Copy link
Contributor Author

njuCZ commented Apr 23, 2021

@magodo the simplest way is to make them typeString, empty string will make the backend service return the default value. This is a little common for aks. But I also agrees that exlipcit type is more helpful. To make it TypeInt, we should set a default value, because 0 is also a valid value.

@magodo
Copy link
Collaborator

magodo commented Apr 23, 2021

If they are O+C, I assume the default is not necessary?

@njuCZ
Copy link
Contributor Author

njuCZ commented Apr 23, 2021

If it's TypeString, O+C has no problem. but if we set it as TypeInt, it will have a default value 0, 0 is a valid value for this property, and the backend service will think client want to set it as 0 and does not return the default value

@magodo
Copy link
Collaborator

magodo commented Apr 23, 2021

Ah.. Because those properties are inside a nested block, which means there is no way to tell whether they are omitted in the config or not..

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @njuCZ - just a couple comments

website/docs/r/kubernetes_cluster.html.markdown Outdated Show resolved Hide resolved
website/docs/r/kubernetes_cluster.html.markdown Outdated Show resolved Hide resolved
website/docs/r/kubernetes_cluster.html.markdown Outdated Show resolved Hide resolved
@njuCZ njuCZ changed the title "azurerm_kubernetes_cluster" - supports "max_node_provision_time","max_total_unready_percentage" and "ok_total_unready_count" "azurerm_kubernetes_cluster" - supports "max_node_provisioning_time","max_unready_percentage" and "max_unready_nodes" Apr 23, 2021
@njuCZ
Copy link
Contributor Author

njuCZ commented Apr 23, 2021

@katbyte thanks for your opinion, I have renamed those fields.

@njuCZ njuCZ requested a review from katbyte April 23, 2021 13:17
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @njuCZ - LGTM 👍

@katbyte katbyte merged commit 2254334 into hashicorp:master Apr 27, 2021
katbyte added a commit that referenced this pull request Apr 27, 2021
@ghost
Copy link

ghost commented Apr 30, 2021

This has been released in version 2.57.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 = "~> 2.57.0"
}
# ... other configuration ...

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants