Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ Then perform the following commands on the root folder:
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
| 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 |
| 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 |
| default\_compute\_class\_enabled | Enable Spot VMs as the default compute class for Node Auto-Provisioning | `bool` | `null` | no |
| default\_max\_pods\_per\_node | The maximum number of pods to schedule per node | `number` | `110` | no |
| deletion\_protection | Whether or not to allow Terraform to destroy the cluster. | `bool` | `true` | no |
| description | The description of the cluster | `string` | `""` | no |
Expand Down
2 changes: 2 additions & 0 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ resource "google_container_cluster" "primary" {

cluster_autoscaling {
enabled = var.cluster_autoscaling.enabled
default_compute_class_enabled = var.default_compute_class_enabled
dynamic "auto_provisioning_defaults" {
for_each = var.cluster_autoscaling.enabled ? [1] : []

Expand Down Expand Up @@ -217,6 +218,7 @@ resource "google_container_cluster" "primary" {
{% endif %}
{% if autopilot_cluster == true %}
cluster_autoscaling {
default_compute_class_enabled = var.default_compute_class_enabled
dynamic "auto_provisioning_defaults" {
for_each = (var.create_service_account || var.service_account != "" || var.boot_disk_kms_key != null) ? [1] : []

Expand Down
7 changes: 7 additions & 0 deletions autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,13 @@ variable "enable_shielded_nodes" {
}

{% endif %}

variable "default_compute_class_enabled" {
type = bool
description = "Enable Spot VMs as the default compute class for Node Auto-Provisioning"
default = null
}

Comment on lines +862 to +867

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's a good point - yeah... that is the way I use it, it is not the correct description.

variable "enable_binary_authorization" {
type = bool
description = "Enable BinAuthZ Admission controller"
Expand Down
12 changes: 6 additions & 6 deletions autogen/main/versions.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,33 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.47.0, < 8"
version = ">= 7.0.0, < 8"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.47.0, < 8"
version = ">= 7.0.0, < 8"
}
{% elif beta_cluster and autopilot_cluster %}
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.47.0, < 8"
version = ">= 7.0.0, < 8"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.47.0, < 8"
version = ">= 7.0.0, < 8"
}
{% elif autopilot_cluster %}
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.47.0, < 8"
version = ">= 7.0.0, < 8"
}
{% else %}
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.47.0, < 8"
version = ">= 7.0.0, < 8"
}
{% endif %}
kubernetes = {
Expand Down
3 changes: 2 additions & 1 deletion cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ resource "google_container_cluster" "primary" {
monitoring_service = local.logmon_config_is_set ? null : var.monitoring_service

cluster_autoscaling {
enabled = var.cluster_autoscaling.enabled
enabled = var.cluster_autoscaling.enabled
default_compute_class_enabled = var.default_compute_class_enabled
dynamic "auto_provisioning_defaults" {
for_each = var.cluster_autoscaling.enabled ? [1] : []

Expand Down
4 changes: 2 additions & 2 deletions examples/simple_fleet_app_operator_permissions/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.39.0"
version = ">= 7.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.39.0"
version = ">= 7.0.0"
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions metadata.display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ spec:
datapath_provider:
name: datapath_provider
title: Datapath Provider
default_compute_class_enabled:
name: default_compute_class_enabled
title: Default Compute Class Enabled
default_max_pods_per_node:
name: default_max_pods_per_node
title: Default Max Pods Per Node
Expand Down
5 changes: 4 additions & 1 deletion metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,9 @@ spec:
description: Enable Shielded Nodes features on all nodes in this cluster
varType: bool
defaultValue: true
- name: default_compute_class_enabled
description: Enable Spot VMs as the default compute class for Node Auto-Provisioning
varType: bool
- name: enable_binary_authorization
description: Enable BinAuthZ Admission controller
varType: bool
Expand Down Expand Up @@ -855,7 +858,7 @@ spec:
- roles/editor
providerVersions:
- source: hashicorp/google
version: ">= 6.47.0, < 8"
version: ">= 7.0.0, < 8"
- source: hashicorp/kubernetes
version: ~> 2.10
- source: hashicorp/random
Expand Down
1 change: 1 addition & 0 deletions modules/beta-autopilot-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Then perform the following commands on the root folder:
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
| 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 |
| default\_compute\_class\_enabled | Enable Spot VMs as the default compute class for Node Auto-Provisioning | `bool` | `null` | no |
| deletion\_protection | Whether or not to allow Terraform to destroy the cluster. | `bool` | `true` | no |
| deploy\_using\_private\_endpoint | A toggle for Terraform and kubectl to connect to the master's internal IP address during deployment. | `bool` | `false` | no |
| description | The description of the cluster | `string` | `""` | no |
Expand Down
1 change: 1 addition & 0 deletions modules/beta-autopilot-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ resource "google_container_cluster" "primary" {
}

cluster_autoscaling {
default_compute_class_enabled = var.default_compute_class_enabled
dynamic "auto_provisioning_defaults" {
for_each = (var.create_service_account || var.service_account != "" || var.boot_disk_kms_key != null) ? [1] : []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ spec:
database_encryption:
name: database_encryption
title: Database Encryption
default_compute_class_enabled:
name: default_compute_class_enabled
title: Default Compute Class Enabled
deletion_protection:
name: deletion_protection
title: Deletion Protection
Expand Down
7 changes: 5 additions & 2 deletions modules/beta-autopilot-private-cluster/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,9 @@ spec:
defaultValue:
- key_name: ""
state: DECRYPTED
- name: default_compute_class_enabled
description: Enable Spot VMs as the default compute class for Node Auto-Provisioning
varType: bool
- name: enable_binary_authorization
description: Enable BinAuthZ Admission controller
varType: bool
Expand Down Expand Up @@ -598,9 +601,9 @@ spec:
- roles/editor
providerVersions:
- source: hashicorp/google
version: ">= 6.47.0, < 8"
version: ">= 7.0.0, < 8"
- source: hashicorp/google-beta
version: ">= 6.47.0, < 8"
version: ">= 7.0.0, < 8"
- source: hashicorp/kubernetes
version: ~> 2.10
- source: hashicorp/random
Expand Down
7 changes: 7 additions & 0 deletions modules/beta-autopilot-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,13 @@ variable "database_encryption" {
}]
}


variable "default_compute_class_enabled" {
type = bool
description = "Enable Spot VMs as the default compute class for Node Auto-Provisioning"
default = null
}

variable "enable_binary_authorization" {
type = bool
description = "Enable BinAuthZ Admission controller"
Expand Down
4 changes: 2 additions & 2 deletions modules/beta-autopilot-private-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.47.0, < 8"
version = ">= 7.0.0, < 8"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.47.0, < 8"
version = ">= 7.0.0, < 8"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
1 change: 1 addition & 0 deletions modules/beta-autopilot-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Then perform the following commands on the root folder:
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
| 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 |
| default\_compute\_class\_enabled | Enable Spot VMs as the default compute class for Node Auto-Provisioning | `bool` | `null` | no |
| deletion\_protection | Whether or not to allow Terraform to destroy the cluster. | `bool` | `true` | no |
| description | The description of the cluster | `string` | `""` | no |
| disable\_default\_snat | Whether to disable the default SNAT to support the private use of public IP addresses | `bool` | `false` | no |
Expand Down
1 change: 1 addition & 0 deletions modules/beta-autopilot-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ resource "google_container_cluster" "primary" {
}

cluster_autoscaling {
default_compute_class_enabled = var.default_compute_class_enabled
dynamic "auto_provisioning_defaults" {
for_each = (var.create_service_account || var.service_account != "" || var.boot_disk_kms_key != null) ? [1] : []

Expand Down
3 changes: 3 additions & 0 deletions modules/beta-autopilot-public-cluster/metadata.display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ spec:
database_encryption:
name: database_encryption
title: Database Encryption
default_compute_class_enabled:
name: default_compute_class_enabled
title: Default Compute Class Enabled
deletion_protection:
name: deletion_protection
title: Deletion Protection
Expand Down
7 changes: 5 additions & 2 deletions modules/beta-autopilot-public-cluster/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,9 @@ spec:
defaultValue:
- key_name: ""
state: DECRYPTED
- name: default_compute_class_enabled
description: Enable Spot VMs as the default compute class for Node Auto-Provisioning
varType: bool
- name: enable_binary_authorization
description: Enable BinAuthZ Admission controller
varType: bool
Expand Down Expand Up @@ -572,9 +575,9 @@ spec:
- roles/editor
providerVersions:
- source: hashicorp/google
version: ">= 6.47.0, < 8"
version: ">= 7.0.0, < 8"
- source: hashicorp/google-beta
version: ">= 6.47.0, < 8"
version: ">= 7.0.0, < 8"
- source: hashicorp/kubernetes
version: ~> 2.10
- source: hashicorp/random
Expand Down
7 changes: 7 additions & 0 deletions modules/beta-autopilot-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,13 @@ variable "database_encryption" {
}]
}


variable "default_compute_class_enabled" {
type = bool
description = "Enable Spot VMs as the default compute class for Node Auto-Provisioning"
default = null
}

variable "enable_binary_authorization" {
type = bool
description = "Enable BinAuthZ Admission controller"
Expand Down
4 changes: 2 additions & 2 deletions modules/beta-autopilot-public-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.47.0, < 8"
version = ">= 7.0.0, < 8"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.47.0, < 8"
version = ">= 7.0.0, < 8"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
1 change: 1 addition & 0 deletions modules/beta-private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ Then perform the following commands on the root folder:
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
| 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 |
| 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 |
| default\_compute\_class\_enabled | Enable Spot VMs as the default compute class for Node Auto-Provisioning | `bool` | `null` | no |
| default\_max\_pods\_per\_node | The maximum number of pods to schedule per node | `number` | `110` | no |
| deletion\_protection | Whether or not to allow Terraform to destroy the cluster. | `bool` | `true` | no |
| deploy\_using\_private\_endpoint | A toggle for Terraform and kubectl to connect to the master's internal IP address during deployment. | `bool` | `false` | no |
Expand Down
3 changes: 2 additions & 1 deletion modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ resource "google_container_cluster" "primary" {
monitoring_service = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? null : var.monitoring_service

cluster_autoscaling {
enabled = var.cluster_autoscaling.enabled
enabled = var.cluster_autoscaling.enabled
default_compute_class_enabled = var.default_compute_class_enabled
dynamic "auto_provisioning_defaults" {
for_each = var.cluster_autoscaling.enabled ? [1] : []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ spec:
datapath_provider:
name: datapath_provider
title: Datapath Provider
default_compute_class_enabled:
name: default_compute_class_enabled
title: Default Compute Class Enabled
default_max_pods_per_node:
name: default_max_pods_per_node
title: Default Max Pods Per Node
Expand Down
7 changes: 5 additions & 2 deletions modules/beta-private-cluster-update-variant/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,9 @@ spec:
description: Enable Shielded Nodes features on all nodes in this cluster
varType: bool
defaultValue: true
- name: default_compute_class_enabled
description: Enable Spot VMs as the default compute class for Node Auto-Provisioning
varType: bool
- name: enable_binary_authorization
description: Enable BinAuthZ Admission controller
varType: bool
Expand Down Expand Up @@ -890,9 +893,9 @@ spec:
- roles/editor
providerVersions:
- source: hashicorp/google
version: ">= 6.47.0, < 8"
version: ">= 7.0.0, < 8"
- source: hashicorp/google-beta
version: ">= 6.47.0, < 8"
version: ">= 7.0.0, < 8"
- source: hashicorp/kubernetes
version: ~> 2.10
- source: hashicorp/random
Expand Down
7 changes: 7 additions & 0 deletions modules/beta-private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,13 @@ variable "enable_shielded_nodes" {
default = true
}


variable "default_compute_class_enabled" {
type = bool
description = "Enable Spot VMs as the default compute class for Node Auto-Provisioning"
default = null
}

variable "enable_binary_authorization" {
type = bool
description = "Enable BinAuthZ Admission controller"
Expand Down
4 changes: 2 additions & 2 deletions modules/beta-private-cluster-update-variant/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.47.0, < 8"
version = ">= 7.0.0, < 8"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.47.0, < 8"
version = ">= 7.0.0, < 8"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
1 change: 1 addition & 0 deletions modules/beta-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ Then perform the following commands on the root folder:
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
| 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 |
| 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 |
| default\_compute\_class\_enabled | Enable Spot VMs as the default compute class for Node Auto-Provisioning | `bool` | `null` | no |
| default\_max\_pods\_per\_node | The maximum number of pods to schedule per node | `number` | `110` | no |
| deletion\_protection | Whether or not to allow Terraform to destroy the cluster. | `bool` | `true` | no |
| deploy\_using\_private\_endpoint | A toggle for Terraform and kubectl to connect to the master's internal IP address during deployment. | `bool` | `false` | no |
Expand Down
3 changes: 2 additions & 1 deletion modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ resource "google_container_cluster" "primary" {
monitoring_service = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? null : var.monitoring_service

cluster_autoscaling {
enabled = var.cluster_autoscaling.enabled
enabled = var.cluster_autoscaling.enabled
default_compute_class_enabled = var.default_compute_class_enabled
dynamic "auto_provisioning_defaults" {
for_each = var.cluster_autoscaling.enabled ? [1] : []

Expand Down
3 changes: 3 additions & 0 deletions modules/beta-private-cluster/metadata.display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ spec:
datapath_provider:
name: datapath_provider
title: Datapath Provider
default_compute_class_enabled:
name: default_compute_class_enabled
title: Default Compute Class Enabled
default_max_pods_per_node:
name: default_max_pods_per_node
title: Default Max Pods Per Node
Expand Down
Loading