-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 - support for auto scaling #3361
Conversation
Duplicate of #3174 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @jlpedrosa,
As the other AKS PR was closed i am going to review and proceed with this one. OVerall it looks good, and thanks for the good property combination validation! Whats left is:
- merge/rebase off master
- test that updates the properties
- updating the docs
Hi @katbyte Your guess was correct regarding the limits, in the docs the thershold is 100 [https://docs.microsoft.com/en-us/azure/aks/quotas-skus-regions](aks limits) I've rebased the PR (there were some conflicts). regarding: "test that updates the properties", as I mentioned in #317 the moment we change the type of agent pool to VMScaleSets (which is required for autoscaling, but it can be enabled withoutautoscaling). Then any put request to the api will fail (which means no updates will work with that type of agent pool). |
FYI, for future reference i have a tool that will run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the updates @jlpedrosa, i've left some comments inline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor typo
I ran the tests against my subscription, everything seemed fine. Do you know when it could me merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @jlpedrosa
Thanks for pushing those changes - apologies for the delayed re-review here!
Taking a look through this is looking good, if we can fix up the remaining minor comments this otherwise LGTM 👍
Thanks!
|
||
if profile.AvailabilityZones != nil && len(*profile.AvailabilityZones) > 0 { | ||
agentPoolProfile["availability_zones"] = utils.FlattenStringSlice(profile.AvailabilityZones) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove this if statement around this flatten? the utils.FlattenStringSlice
should handle this being nil (and we should always set this complex type if there's no elements, since that'll then show a diff)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tombuildsstuff:
In this case, I am protecting us against some behaviours of the API where an empty array is not the same as not sending an array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But here we are setting the terraform side. Any protection on the API side should be where we set that property on the SDK (only set it if tf data is !nil and len > 0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it here and just left it on the expand. Is that OK?
I've rebased it, but your comments were addressed few days ago, I don't know if you could have a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jlpedrosa,
Thank you for the updates, i've left some comments inline and replied to yours so that once addressed this should be good to merge
|
||
* `enable_auto_scaling` - (Optional) Whether to enable auto-scaler [Autoscaling details](https://docs.microsoft.com/en-us/azure/aks/cluster-autoscaler) | ||
|
||
~> **Note:** Support for the `type` of `VirtualMachineScaleSets` is currently in Public Preview on an opt-in basis. You can enable this feature using the Azure CLI by running `az feature register --name VMSSPreview --namespace Microsoft.ContainerService` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is spurious as its duplicated below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi
if you mean
~> **Note:** Support for the `type` of `VirtualMachineScaleSets` is currently in Public Preview on an opt-in basis. You can enable this feature using the Azure CLI by running `az feature register --name VMSSPreview --namespace Microsoft.ContainerService`
No, it's not duplicated, it is a requirement for autoscale sets, it only works with VirtualMachineScaleSets. I've added more comments in the doc and remove the line. Let me know if now is clear or how would you prefer it.
|
||
if profile.AvailabilityZones != nil && len(*profile.AvailabilityZones) > 0 { | ||
agentPoolProfile["availability_zones"] = utils.FlattenStringSlice(profile.AvailabilityZones) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But here we are setting the terraform side. Any protection on the API side should be where we set that property on the SDK (only set it if tf data is !nil and len > 0)
Hi @katbyte I've fixed most of the comments, and final questions to few. Please your feedback, I've rebased and squashed it as it was giving merge errors. Sorry for the delay. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates @jlpedrosa, aside from one minor comment this LGTM now 👍
Hope you don't mind but i am going to push a fix for that last comment to get this merged 🙂
@@ -1481,6 +1546,8 @@ resource "azurerm_kubernetes_cluster" "test" { | |||
name = "default" | |||
count = "1" | |||
vm_size = "Standard_DS2_v2" | |||
name = "default" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property has been duplicated
name = "default" |
When will the new release be pushed? Waiting for this.. |
@katbyte I've seen that the milestone deadline was yesterday however no new release has been made. Any updates? |
I'm also waiting for this release. Is there any news when it's going to be GA? |
So according to my latest info they have a milestone open for the next release. This is already a week overdue (although it says 2 days overdue, but that is because they keep moving the due date.) However, we are now at 97% complete so I'm expecting @katbyte to release today or tomorrow (24th/25th of July) A confirmation by @katbyte would be appreciated though. Link to the milestone: https://github.com/terraform-providers/terraform-provider-azurerm/milestone/48 |
We're now at 100% so it should be released asap. |
This has been released in version 1.32.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 = "~> 1.32.0"
}
# ... other configuration ... |
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! |
Hi
This PR adds auto scale and availability zones capabilities to AKS resource and data providers.
It bumps the API version for AKS, there are other PR pending regarding that matter so I expect a conflict depends on what gets merged first.
https://github.com/terraform-providers/terraform-provider-azurerm/pull/3262
This depends on the following features:
az feature register --namespace Microsoft.ContainerService -n AvailabilityZonePreview
az feature register --namespace Microsoft.ContainerService --name VMSSPreview
az provider register -n Microsoft.ContainerService