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: Add support for KEDA Autoscaler #18967

Merged
merged 4 commits into from
Oct 27, 2022

Conversation

favoretti
Copy link
Collaborator

@favoretti favoretti commented Oct 25, 2022

The reason I made it a block in schema is cause it also supports VPA, but since I'm selfish and time-deprived atm, I just implemented KEDA for now. Making this a block will allow for adding VPA in the future.

AKS-KedaPreview feature needs to be enabled in Microsoft.ContainerService namespace for this to work.

@favoretti
Copy link
Collaborator Author

$ TF_ACC=1 go test -v ./internal/services/containers -timeout=1000m -run='TestAccKubernetesCluster_workloadAutoscalerProfileKeda'
=== RUN   TestAccKubernetesCluster_workloadAutoscalerProfileKeda
=== PAUSE TestAccKubernetesCluster_workloadAutoscalerProfileKeda
=== CONT  TestAccKubernetesCluster_workloadAutoscalerProfileKeda
--- PASS: TestAccKubernetesCluster_workloadAutoscalerProfileKeda (803.01s)
PASS
ok  	github.com/hashicorp/terraform-provider-azurerm/internal/services/containers	804.172s

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.

LGTM 🤖

Copy link
Member

@stephybun stephybun 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 @favoretti. The behaviour of blocks (at least on this resource) is that if the block was present but then absent the feature should be disabled. While messing around with this I noticed that if I try to disable KEDA by removing the block we aren't disabling it.

=== CONT  TestAccKubernetesCluster_workloadAutoscalerProfileKeda
    testcase.go:110: Step 2/2 error: Check failed: Check 2/2 error: azurerm_kubernetes_cluster.test: Attribute 'workload_autoscaler_profile.0.keda_enabled' expected "false", got "true"

To elaborate on the above error message I changed the second apply in that test to a config where the block is absent.

Once that's fixed this should be good to go though!

Co-authored-by: stephybun <steph@hashicorp.com>
@favoretti
Copy link
Collaborator Author

$ TF_ACC=1 go test -v ./internal/services/containers -timeout=1000m -run='TestAccKubernetesCluster_workloadAutoscalerProfileKedaOnOff'
=== RUN   TestAccKubernetesCluster_workloadAutoscalerProfileKedaOnOff
=== PAUSE TestAccKubernetesCluster_workloadAutoscalerProfileKedaOnOff
=== CONT  TestAccKubernetesCluster_workloadAutoscalerProfileKedaOnOff
--- PASS: TestAccKubernetesCluster_workloadAutoscalerProfileKedaOnOff (790.52s)
PASS
ok  	github.com/hashicorp/terraform-provider-azurerm/internal/services/containers	791.656s
$ TF_LOG_PATH=debug TF_LOG=trace TF_ACC=1 go test -v ./internal/services/containers -timeout=1000m -run='TestAccKubernetesCluster_workloadAutoscalerProfileKedaOnAbsent'
=== RUN   TestAccKubernetesCluster_workloadAutoscalerProfileKedaOnAbsent
=== PAUSE TestAccKubernetesCluster_workloadAutoscalerProfileKedaOnAbsent
=== CONT  TestAccKubernetesCluster_workloadAutoscalerProfileKedaOnAbsent
--- PASS: TestAccKubernetesCluster_workloadAutoscalerProfileKedaOnAbsent (824.45s)
PASS
ok  	github.com/hashicorp/terraform-provider-azurerm/internal/services/containers	825.598s

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

Thanks @favoretti! LGTM 🎉

@stephybun stephybun merged commit ef0f246 into hashicorp:main Oct 27, 2022
@github-actions github-actions bot added this to the v3.29.0 milestone Oct 27, 2022
stephybun added a commit that referenced this pull request Oct 27, 2022
@github-actions
Copy link

This functionality has been released in v3.29.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@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 Nov 27, 2022
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.

None yet

3 participants