Skip to content

Commit e7c3cc0

Browse files
authored
Merge branch 'main' into gke-comp-change-2510
2 parents 487433a + b589f64 commit e7c3cc0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+448
-113
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ Then perform the following commands on the root folder:
146146
| additional\_ip\_range\_pods | List of _names_ of the additional secondary subnet ip ranges to use for pods | `list(string)` | `[]` | no |
147147
| additional\_ip\_ranges\_config | the configuration for individual additional subnetworks attached to the cluster | `list(object({ subnetwork = string, pod_ipv4_range_names = list(string) }))` | `[]` | no |
148148
| additive\_vpc\_scope\_dns\_domain | This will enable Cloud DNS additive VPC scope. Must provide a domain name that is unique within the VPC. For this to work cluster\_dns = `CLOUD_DNS` and cluster\_dns\_scope = `CLUSTER_SCOPE` must both be set as well. | `string` | `""` | no |
149+
| anonymous\_authentication\_config\_mode | Allows users to restrict or enable anonymous access to the cluster. Valid values are `ENABLED` and `LIMITED`. | `string` | `null` | no |
149150
| authenticator\_security\_group | The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format [email protected] | `string` | `null` | no |
150151
| boot\_disk\_kms\_key | The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool, if not overridden in `node_pools`. This should be of the form projects/[KEY\_PROJECT\_ID]/locations/[LOCATION]/keyRings/[RING\_NAME]/cryptoKeys/[KEY\_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption | `string` | `null` | no |
151152
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | <pre>object({<br> enabled = bool<br> autoscaling_profile = string<br> min_cpu_cores = optional(number)<br> max_cpu_cores = optional(number)<br> min_memory_gb = optional(number)<br> max_memory_gb = optional(number)<br> gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))<br> auto_repair = bool<br> auto_upgrade = bool<br> disk_size = optional(number)<br> disk_type = optional(string)<br> image_type = optional(string)<br> strategy = optional(string)<br> max_surge = optional(number)<br> max_unavailable = optional(number)<br> node_pool_soak_duration = optional(string)<br> batch_soak_duration = optional(string)<br> batch_percentage = optional(number)<br> batch_node_count = optional(number)<br> enable_secure_boot = optional(bool, false)<br> enable_integrity_monitoring = optional(bool, true)<br> })</pre> | <pre>{<br> "auto_repair": true,<br> "auto_upgrade": true,<br> "autoscaling_profile": "BALANCED",<br> "disk_size": 100,<br> "disk_type": "pd-standard",<br> "enable_integrity_monitoring": true,<br> "enable_secure_boot": false,<br> "enabled": false,<br> "gpu_resources": [],<br> "image_type": "COS_CONTAINERD",<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
@@ -159,6 +160,7 @@ Then perform the following commands on the root folder:
159160
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
160161
| 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 |
161162
| 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 Spot VMs as the default compute class for Node Auto-Provisioning | `bool` | `null` | no |
162164
| default\_max\_pods\_per\_node | The maximum number of pods to schedule per node | `number` | `110` | no |
163165
| deletion\_protection | Whether or not to allow Terraform to destroy the cluster. | `bool` | `true` | no |
164166
| description | The description of the cluster | `string` | `""` | no |

autogen/main/cluster.tf.tmpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ resource "google_container_cluster" "primary" {
156156

157157
cluster_autoscaling {
158158
enabled = var.cluster_autoscaling.enabled
159+
default_compute_class_enabled = var.default_compute_class_enabled
159160
dynamic "auto_provisioning_defaults" {
160161
for_each = var.cluster_autoscaling.enabled ? [1] : []
161162

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

@@ -274,6 +276,13 @@ resource "google_container_cluster" "primary" {
274276

275277
in_transit_encryption_config = var.in_transit_encryption_config
276278

279+
dynamic "anonymous_authentication_config" {
280+
for_each = var.anonymous_authentication_config_mode != null ? [1] : []
281+
content {
282+
mode = var.anonymous_authentication_config_mode
283+
}
284+
}
285+
277286
dynamic "network_performance_config" {
278287
for_each = var.total_egress_bandwidth_tier != null ? [1] : []
279288
content {

autogen/main/variables.tf.tmpl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,12 @@ variable "in_transit_encryption_config" {
728728
default = null
729729
}
730730

731+
variable "anonymous_authentication_config_mode" {
732+
description = "Allows users to restrict or enable anonymous access to the cluster. Valid values are `ENABLED` and `LIMITED`."
733+
type = string
734+
default = null
735+
}
736+
731737
variable "total_egress_bandwidth_tier" {
732738
type = string
733739
description = "Specifies the total network bandwidth tier for NodePools in the cluster. Valid values are `TIER_UNSPECIFIED` and `TIER_1`. Defaults to `TIER_UNSPECIFIED`."
@@ -858,6 +864,13 @@ variable "enable_shielded_nodes" {
858864
}
859865

860866
{% endif %}
867+
868+
variable "default_compute_class_enabled" {
869+
type = bool
870+
description = "Enable Spot VMs as the default compute class for Node Auto-Provisioning"
871+
default = null
872+
}
873+
861874
variable "enable_binary_authorization" {
862875
type = bool
863876
description = "Enable BinAuthZ Admission controller"

autogen/main/versions.tf.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,33 @@ terraform {
2424
required_providers {
2525
google = {
2626
source = "hashicorp/google"
27-
version = ">= 6.47.0, < 8"
27+
version = ">= 7.0.0, < 8"
2828
}
2929
google-beta = {
3030
source = "hashicorp/google-beta"
31-
version = ">= 6.47.0, < 8"
31+
version = ">= 7.0.0, < 8"
3232
}
3333
{% elif beta_cluster and autopilot_cluster %}
3434
required_providers {
3535
google = {
3636
source = "hashicorp/google"
37-
version = ">= 6.47.0, < 8"
37+
version = ">= 7.0.0, < 8"
3838
}
3939
google-beta = {
4040
source = "hashicorp/google-beta"
41-
version = ">= 6.47.0, < 8"
41+
version = ">= 7.0.0, < 8"
4242
}
4343
{% elif autopilot_cluster %}
4444
required_providers {
4545
google = {
4646
source = "hashicorp/google"
47-
version = ">= 6.47.0, < 8"
47+
version = ">= 7.0.0, < 8"
4848
}
4949
{% else %}
5050
required_providers {
5151
google = {
5252
source = "hashicorp/google"
53-
version = ">= 6.47.0, < 8"
53+
version = ">= 7.0.0, < 8"
5454
}
5555
{% endif %}
5656
kubernetes = {

cluster.tf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ resource "google_container_cluster" "primary" {
122122
monitoring_service = local.logmon_config_is_set ? null : var.monitoring_service
123123

124124
cluster_autoscaling {
125-
enabled = var.cluster_autoscaling.enabled
125+
enabled = var.cluster_autoscaling.enabled
126+
default_compute_class_enabled = var.default_compute_class_enabled
126127
dynamic "auto_provisioning_defaults" {
127128
for_each = var.cluster_autoscaling.enabled ? [1] : []
128129

@@ -213,6 +214,13 @@ resource "google_container_cluster" "primary" {
213214

214215
in_transit_encryption_config = var.in_transit_encryption_config
215216

217+
dynamic "anonymous_authentication_config" {
218+
for_each = var.anonymous_authentication_config_mode != null ? [1] : []
219+
content {
220+
mode = var.anonymous_authentication_config_mode
221+
}
222+
}
223+
216224
dynamic "network_performance_config" {
217225
for_each = var.total_egress_bandwidth_tier != null ? [1] : []
218226
content {

examples/simple_fleet_app_operator_permissions/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ terraform {
2020
required_providers {
2121
google = {
2222
source = "hashicorp/google"
23-
version = ">= 6.39.0"
23+
version = ">= 7.0.0"
2424
}
2525
google-beta = {
2626
source = "hashicorp/google-beta"
27-
version = ">= 6.39.0"
27+
version = ">= 7.0.0"
2828
}
2929
}
3030
}

metadata.display.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ spec:
4848
additive_vpc_scope_dns_domain:
4949
name: additive_vpc_scope_dns_domain
5050
title: Additive Vpc Scope Dns Domain
51+
anonymous_authentication_config_mode:
52+
name: anonymous_authentication_config_mode
53+
title: Anonymous Authentication Config Mode
5154
authenticator_security_group:
5255
name: authenticator_security_group
5356
title: Authenticator Security Group
@@ -87,6 +90,9 @@ spec:
8790
datapath_provider:
8891
name: datapath_provider
8992
title: Datapath Provider
93+
default_compute_class_enabled:
94+
name: default_compute_class_enabled
95+
title: Default Compute Class Enabled
9096
default_max_pods_per_node:
9197
name: default_max_pods_per_node
9298
title: Default Max Pods Per Node

metadata.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,9 @@ spec:
570570
- name: in_transit_encryption_config
571571
description: Defines the config of in-transit encryption. Valid values are `IN_TRANSIT_ENCRYPTION_DISABLED` and `IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT`.
572572
varType: string
573+
- name: anonymous_authentication_config_mode
574+
description: Allows users to restrict or enable anonymous access to the cluster. Valid values are `ENABLED` and `LIMITED`.
575+
varType: string
573576
- name: total_egress_bandwidth_tier
574577
description: Specifies the total network bandwidth tier for NodePools in the cluster. Valid values are `TIER_UNSPECIFIED` and `TIER_1`. Defaults to `TIER_UNSPECIFIED`.
575578
varType: string
@@ -650,6 +653,9 @@ spec:
650653
description: Enable Shielded Nodes features on all nodes in this cluster
651654
varType: bool
652655
defaultValue: true
656+
- name: default_compute_class_enabled
657+
description: Enable Spot VMs as the default compute class for Node Auto-Provisioning
658+
varType: bool
653659
- name: enable_binary_authorization
654660
description: Enable BinAuthZ Admission controller
655661
varType: bool
@@ -855,7 +861,7 @@ spec:
855861
- roles/editor
856862
providerVersions:
857863
- source: hashicorp/google
858-
version: ">= 6.47.0, < 8"
864+
version: ">= 7.0.0, < 8"
859865
- source: hashicorp/kubernetes
860866
version: ~> 2.10
861867
- source: hashicorp/random

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,14 @@ Then perform the following commands on the root folder:
7979
| additional\_ip\_range\_pods | List of _names_ of the additional secondary subnet ip ranges to use for pods | `list(string)` | `[]` | no |
8080
| additional\_ip\_ranges\_config | the configuration for individual additional subnetworks attached to the cluster | `list(object({ subnetwork = string, pod_ipv4_range_names = list(string) }))` | `[]` | no |
8181
| allow\_net\_admin | (Optional) Enable NET\_ADMIN for the cluster. | `bool` | `null` | no |
82+
| anonymous\_authentication\_config\_mode | Allows users to restrict or enable anonymous access to the cluster. Valid values are `ENABLED` and `LIMITED`. | `string` | `null` | no |
8283
| authenticator\_security\_group | The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format [email protected] | `string` | `null` | no |
8384
| boot\_disk\_kms\_key | The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool, if not overridden in `node_pools`. This should be of the form projects/[KEY\_PROJECT\_ID]/locations/[LOCATION]/keyRings/[RING\_NAME]/cryptoKeys/[KEY\_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption | `string` | `null` | no |
8485
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
8586
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
8687
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
8788
| 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 Spot VMs as the default compute class for Node Auto-Provisioning | `bool` | `null` | no |
8890
| deletion\_protection | Whether or not to allow Terraform to destroy the cluster. | `bool` | `true` | no |
8991
| deploy\_using\_private\_endpoint | A toggle for Terraform and kubectl to connect to the master's internal IP address during deployment. | `bool` | `false` | no |
9092
| description | The description of the cluster | `string` | `""` | no |

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ resource "google_container_cluster" "primary" {
103103
}
104104

105105
cluster_autoscaling {
106+
default_compute_class_enabled = var.default_compute_class_enabled
106107
dynamic "auto_provisioning_defaults" {
107108
for_each = (var.create_service_account || var.service_account != "" || var.boot_disk_kms_key != null) ? [1] : []
108109

@@ -133,6 +134,13 @@ resource "google_container_cluster" "primary" {
133134

134135
in_transit_encryption_config = var.in_transit_encryption_config
135136

137+
dynamic "anonymous_authentication_config" {
138+
for_each = var.anonymous_authentication_config_mode != null ? [1] : []
139+
content {
140+
mode = var.anonymous_authentication_config_mode
141+
}
142+
}
143+
136144
dynamic "network_performance_config" {
137145
for_each = var.total_egress_bandwidth_tier != null ? [1] : []
138146
content {

0 commit comments

Comments
 (0)