Skip to content

Commit 1cfea5d

Browse files
authored
gke: add default_compute_class_enabled flag (#1182)
This is related to https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#default_compute_class_enabled-1. More info: https://docs.cloud.google.com/kubernetes-engine/docs/reference/crds/computeclass#nodepoolconfig We want to use the this variable on our GKE cluster on the ecosystems clusters. Signed-off-by: Hector Fernandez <[email protected]>
1 parent cd9895e commit 1cfea5d

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

modules/gke/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ No modules.
3535
| <a name="input_cluster_autoscaling_memory_limits"></a> [cluster\_autoscaling\_memory\_limits](#input\_cluster\_autoscaling\_memory\_limits) | Cluster autoscaling memory limits | <pre>object({<br/> resource_type = optional(string, "memory"),<br/> minimum = optional(number, 8)<br/> maximum = optional(number, 80)<br/> })</pre> | `null` | no |
3636
| <a name="input_cluster_autoscaling_profile"></a> [cluster\_autoscaling\_profile](#input\_cluster\_autoscaling\_profile) | Cluster autoscaling profile | `string` | `null` | no |
3737
| <a name="input_cluster_autoscaling_provisioning_defaults"></a> [cluster\_autoscaling\_provisioning\_defaults](#input\_cluster\_autoscaling\_provisioning\_defaults) | Cluster autoscaling provisioning defaults | <pre>object({<br/> disk_size = optional(number, null)<br/> disk_type = optional(string, null)<br/> shielded_instance_config = optional(object({<br/> enable_secure_boot = optional(bool, null)<br/> enable_integrity_monitoring = optional(bool, null)<br/> }), null)<br/> management = optional(object({<br/> auto_upgrade = optional(bool, null)<br/> auto_repair = optional(bool, null)<br/> }), null)<br/> })</pre> | `null` | no |
38+
| <a name="input_default_compute_class_enabled"></a> [default\_compute\_class\_enabled](#input\_default\_compute\_class\_enabled) | Specifies whether default compute class behavior is enabled. If enabled, cluster autoscaler will use Compute Class with name default for all the workloads, if not overridden. | `bool` | `false` | no |
3839
| <a name="input_deletion_protection"></a> [deletion\_protection](#input\_deletion\_protection) | Toggle to prevent accidental deletion of resources. | `bool` | `true` | no |
3940
| <a name="input_enable_private_nodes"></a> [enable\_private\_nodes](#input\_enable\_private\_nodes) | Enable private nodes by default | `bool` | `false` | no |
4041
| <a name="input_extra_roles"></a> [extra\_roles](#input\_extra\_roles) | Extra roles to add to the cluster's default service account | `map(string)` | `{}` | no |

modules/gke/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ resource "google_container_cluster" "this" {
9797
for_each = var.cluster_autoscaling == false ? [] : ["placeholder"]
9898

9999
content {
100-
enabled = var.cluster_autoscaling
100+
enabled = var.cluster_autoscaling
101+
default_compute_class_enabled = var.default_compute_class_enabled
101102
resource_limits {
102103
resource_type = var.cluster_autoscaling_cpu_limits.resource_type
103104
minimum = var.cluster_autoscaling_cpu_limits.minimum

modules/gke/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,9 @@ variable "product" {
176176
type = string
177177
default = "unknown"
178178
}
179+
180+
variable "default_compute_class_enabled" {
181+
default = false
182+
type = bool
183+
description = "Specifies whether default compute class behavior is enabled. If enabled, cluster autoscaler will use Compute Class with name default for all the workloads, if not overridden."
184+
}

0 commit comments

Comments
 (0)