Skip to content

Commit 1753bf6

Browse files
committed
feat: add default_compute_class_enabled variable for autopilot clusters
This change introduces the default_compute_class_enabled variable to enable the default compute class for Node Auto-Provisioning across various cluster configurations. This enhancement improves the flexibility and usability of the cluster setup process.
1 parent cf486f5 commit 1753bf6

File tree

29 files changed

+26
-84
lines changed

29 files changed

+26
-84
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ Then perform the following commands on the root folder:
160160
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
161161
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` | <pre>[<br> {<br> "key_name": "",<br> "state": "DECRYPTED"<br> }<br>]</pre> | no |
162162
| datapath\_provider | The desired datapath provider for this cluster. By default, `DATAPATH_PROVIDER_UNSPECIFIED` enables the IPTables-based kube-proxy implementation. `ADVANCED_DATAPATH` enables Dataplane-V2 feature. | `string` | `"DATAPATH_PROVIDER_UNSPECIFIED"` | no |
163-
| default\_compute\_class\_enabled | Enable default compute class for Node Auto-Provisioning | `bool` | `null` | no |
164163
| default\_max\_pods\_per\_node | The maximum number of pods to schedule per node | `number` | `110` | no |
165164
| deletion\_protection | Whether or not to allow Terraform to destroy the cluster. | `bool` | `true` | no |
166165
| description | The description of the cluster | `string` | `""` | no |

autogen/main/variables.tf.tmpl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,6 @@ variable "cluster_autoscaling" {
367367
description = "Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling)"
368368
}
369369

370-
variable "default_compute_class_enabled" {
371-
type = bool
372-
description = "Enable default compute class for Node Auto-Provisioning"
373-
default = null
374-
}
375-
376370
variable "node_pools_taints" {
377371
type = map(list(object({ key = string, value = string, effect = string })))
378372
description = "Map of lists containing node taints by node-pool name"
@@ -872,7 +866,14 @@ variable "enable_shielded_nodes" {
872866
}
873867

874868
{% endif %}
869+
{% if autopilot_cluster == true %}
870+
variable "default_compute_class_enabled" {
871+
type = bool
872+
description = "Enable default compute class for Node Auto-Provisioning"
873+
default = null
874+
}
875875

876+
{% endif %}
876877
variable "enable_binary_authorization" {
877878
type = bool
878879
description = "Enable BinAuthZ Admission controller"

metadata.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,6 @@ spec:
388388
max_memory_gb: 0
389389
min_cpu_cores: 0
390390
min_memory_gb: 0
391-
- name: default_compute_class_enabled
392-
description: Enable default compute class for Node Auto-Provisioning
393-
varType: bool
394391
- name: node_pools_taints
395392
description: Map of lists containing node taints by node-pool name
396393
varType: map(list(object({ key = string, value = string, effect = string })))

modules/beta-autopilot-private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ Then perform the following commands on the root folder:
8686
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
8787
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
8888
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` | <pre>[<br> {<br> "key_name": "",<br> "state": "DECRYPTED"<br> }<br>]</pre> | no |
89+
| default\_compute\_class\_enabled | Enable default compute class for Node Auto-Provisioning | `bool` | `null` | no |
8990
| deletion\_protection | Whether or not to allow Terraform to destroy the cluster. | `bool` | `true` | no |
9091
| deploy\_using\_private\_endpoint | A toggle for Terraform and kubectl to connect to the master's internal IP address during deployment. | `bool` | `false` | no |
9192
| description | The description of the cluster | `string` | `""` | no |

modules/beta-autopilot-private-cluster/metadata.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,9 @@ spec:
452452
defaultValue:
453453
- key_name: ""
454454
state: DECRYPTED
455+
- name: default_compute_class_enabled
456+
description: Enable default compute class for Node Auto-Provisioning
457+
varType: bool
455458
- name: enable_binary_authorization
456459
description: Enable BinAuthZ Admission controller
457460
varType: bool

modules/beta-autopilot-private-cluster/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,11 @@ variable "database_encryption" {
536536
}]
537537
}
538538

539+
variable "default_compute_class_enabled" {
540+
type = bool
541+
description = "Enable default compute class for Node Auto-Provisioning"
542+
default = null
543+
}
539544

540545
variable "enable_binary_authorization" {
541546
type = bool

modules/beta-autopilot-public-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Then perform the following commands on the root folder:
8080
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
8181
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
8282
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` | <pre>[<br> {<br> "key_name": "",<br> "state": "DECRYPTED"<br> }<br>]</pre> | no |
83+
| default\_compute\_class\_enabled | Enable default compute class for Node Auto-Provisioning | `bool` | `null` | no |
8384
| deletion\_protection | Whether or not to allow Terraform to destroy the cluster. | `bool` | `true` | no |
8485
| description | The description of the cluster | `string` | `""` | no |
8586
| disable\_default\_snat | Whether to disable the default SNAT to support the private use of public IP addresses | `bool` | `false` | no |

modules/beta-autopilot-public-cluster/metadata.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,9 @@ spec:
430430
defaultValue:
431431
- key_name: ""
432432
state: DECRYPTED
433+
- name: default_compute_class_enabled
434+
description: Enable default compute class for Node Auto-Provisioning
435+
varType: bool
433436
- name: enable_binary_authorization
434437
description: Enable BinAuthZ Admission controller
435438
varType: bool

modules/beta-autopilot-public-cluster/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,11 @@ variable "database_encryption" {
500500
}]
501501
}
502502

503+
variable "default_compute_class_enabled" {
504+
type = bool
505+
description = "Enable default compute class for Node Auto-Provisioning"
506+
default = null
507+
}
503508

504509
variable "enable_binary_authorization" {
505510
type = bool

modules/beta-private-cluster-update-variant/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ Then perform the following commands on the root folder:
194194
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
195195
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` | <pre>[<br> {<br> "key_name": "",<br> "state": "DECRYPTED"<br> }<br>]</pre> | no |
196196
| datapath\_provider | The desired datapath provider for this cluster. By default, `DATAPATH_PROVIDER_UNSPECIFIED` enables the IPTables-based kube-proxy implementation. `ADVANCED_DATAPATH` enables Dataplane-V2 feature. | `string` | `"DATAPATH_PROVIDER_UNSPECIFIED"` | no |
197-
| default\_compute\_class\_enabled | Enable default compute class for Node Auto-Provisioning | `bool` | `null` | no |
198197
| default\_max\_pods\_per\_node | The maximum number of pods to schedule per node | `number` | `110` | no |
199198
| deletion\_protection | Whether or not to allow Terraform to destroy the cluster. | `bool` | `true` | no |
200199
| deploy\_using\_private\_endpoint | A toggle for Terraform and kubectl to connect to the master's internal IP address during deployment. | `bool` | `false` | no |

0 commit comments

Comments
 (0)