-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: support enabling default compute class in cluster autoscaler #2442
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
base: main
Are you sure you want to change the base?
feat: support enabling default compute class in cluster autoscaler #2442
Conversation
apeabody
left a comment
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 contribution @romancin!
Please resolve the linter error:
╷
│ Error: Unsupported argument
│
│ on ../../modules/beta-private-cluster/cluster.tf line 179, in resource "google_container_cluster" "primary":
│ 179: default_compute_class_enabled = lookup(var.cluster_autoscaling, "enable_default_compute_class", false)
│
│ An argument named "default_compute_class_enabled" is not expected here.
Which google provider version is the linter using? Because this argument is available only since v7. |
Got it - It's not the linter per say, but all the relevant versions constraints in the Terraform code as the highest allowed is selected. In this case it's the most recent v6.x. I recommend you start by bumping the relevant minimum versions in https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/main/autogen/main/versions.tf.tmpl#L27, as that will more clearly illustrate the dependencies. I know at a minimum we are waiting on #2456 for some examples. |
|
Any news on this one? 1.33 is the now in the STABLE channel and ComputeClasses are such a nice feature! |
|
Can we please get an update on this? The last release enabled this feature, but it doesn't work without this PR. |
|
Bump |
3a4cf85 to
0fde8c6
Compare
|
Ok, I see it is failing because in autopilot mode, no |
Hi @romancin - I haven't looked through the PR in depth, but wanted to pass along that the templates can have different variables/behavior/etc for standard vs autopilot clusters. For example |
|
/gemini review |
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.
Code Review
This pull request refactors the configuration for enabling the default compute class in the cluster autoscaler. The default_compute_class_enabled variable is moved into the cluster_autoscaling object, which improves configuration structure. However, this change introduces a critical issue in the autopilot cluster modules (beta-autopilot-private-cluster and beta-autopilot-public-cluster). These modules now reference var.cluster_autoscaling, which is not defined for them, and this will cause Terraform deployments to fail. The template files need to be adjusted to correctly handle the configuration for autopilot clusters.
36e2adb to
cf486f5
Compare
|
Kept the variable for autopilot. This can be reviewed again. |
Hi @romancin - From the linter: |
…tandard clusters For standard clusters, which have the cluster_autoscaling block, move the enabling of default compute class to that block. For autopilot clusters, keep the enabling of default compute class in the main variables.tf file.
1753bf6 to
4d840c2
Compare
Sorry @apeabody , I moved the variable incorrectly for autopilot clusters (inside an incorrect conditional). Now it is fine, and all the commits squashed so the PR is cleaner. Could you execute the linter again please? Thank you very much! |
This PR enables Default Compute Class support for Cluster Autoscaler.