Skip to content

Commit 94683b9

Browse files
committed
add support for pod_cidr_overprovision_config
Signed-off-by: drfaust92 <[email protected]>
1 parent d30964c commit 94683b9

Some content is hidden

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

51 files changed

+320
-6
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ Then perform the following commands on the root folder:
252252
| notification\_config\_topic | The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}. | `string` | `""` | no |
253253
| notification\_filter\_event\_type | Choose what type of notifications you want to receive. If no filters are applied, you'll receive all notification types. Can be used to filter what notifications are sent. Accepted values are UPGRADE\_AVAILABLE\_EVENT, UPGRADE\_EVENT, and SECURITY\_BULLETIN\_EVENT. | `list(string)` | `[]` | no |
254254
| parallelstore\_csi\_driver | Whether the Parallelstore CSI driver Addon is enabled for this cluster. | `bool` | `null` | no |
255+
| pod\_cidr\_overprovision\_config | Configuration for cluster level pod cidr overprovision. | `object({ disabled = bool })` | <pre>{<br> "disabled": null<br>}</pre> | no |
255256
| project\_id | The project ID to host the cluster in (required) | `string` | n/a | yes |
256257
| ray\_operator\_config | The Ray Operator Addon configuration for this cluster. | <pre>object({<br> enabled = bool<br> logging_enabled = optional(bool, false)<br> monitoring_enabled = optional(bool, false)<br> })</pre> | <pre>{<br> "enabled": false,<br> "logging_enabled": false,<br> "monitoring_enabled": false<br>}</pre> | no |
257258
| rbac\_binding\_config | RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created. | <pre>object({<br> enable_insecure_binding_system_unauthenticated = optional(bool, null)<br> enable_insecure_binding_system_authenticated = optional(bool, null)<br> })</pre> | <pre>{<br> "enable_insecure_binding_system_authenticated": null,<br> "enable_insecure_binding_system_unauthenticated": null<br>}</pre> | no |
@@ -402,6 +403,7 @@ The node_pools variable takes the following parameters:
402403
| queued_provisioning | Makes nodes obtainable through the ProvisioningRequest API exclusively. | | Optional |
403404
| gpu_sharing_strategy | The type of GPU sharing strategy to enable on the GPU node. Accepted values are: "TIME_SHARING" and "MPS". | | Optional |
404405
| max_shared_clients_per_gpu | The maximum number of containers that can share a GPU. | | Optional |
406+
| pod_cidr_overprovision_config | Configuration for node-pool level pod cidr overprovision. If not set, the cluster level setting will be inherited. | | Optional |
405407
| total_egress_bandwidth_tier | Specifies the total network bandwidth tier. Valid values are: "TIER_1" and "TIER_UNSPECIFIED". | | Optional |
406408
| consume_reservation_type | The type of reservation consumption. Accepted values are: "UNSPECIFIED": Default value (should not be specified). "NO_RESERVATION": Do not consume from any reserved capacity, "ANY_RESERVATION": Consume any reservation available, "SPECIFIC_RESERVATION": Must consume from a specific reservation. Must specify key value fields for specifying the reservations. | | Optional |
407409
| reservation_affinity_key | The label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify "compute.googleapis.com/reservation-name" as the key and specify the name of your reservation as its value. | | Optional |

autogen/main/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ The node_pools variable takes the following parameters:
280280
| queued_provisioning | Makes nodes obtainable through the ProvisioningRequest API exclusively. | | Optional |
281281
| gpu_sharing_strategy | The type of GPU sharing strategy to enable on the GPU node. Accepted values are: "TIME_SHARING" and "MPS". | | Optional |
282282
| max_shared_clients_per_gpu | The maximum number of containers that can share a GPU. | | Optional |
283+
| pod_cidr_overprovision_config | Configuration for node-pool level pod cidr overprovision. If not set, the cluster level setting will be inherited. | | Optional |
283284
| total_egress_bandwidth_tier | Specifies the total network bandwidth tier. Valid values are: "TIER_1" and "TIER_UNSPECIFIED". | | Optional |
284285
| consume_reservation_type | The type of reservation consumption. Accepted values are: "UNSPECIFIED": Default value (should not be specified). "NO_RESERVATION": Do not consume from any reserved capacity, "ANY_RESERVATION": Consume any reservation available, "SPECIFIC_RESERVATION": Must consume from a specific reservation. Must specify key value fields for specifying the reservations. | | Optional |
285286
| reservation_affinity_key | The label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify "compute.googleapis.com/reservation-name" as the key and specify the name of your reservation as its value. | | Optional |

autogen/main/cluster.tf.tmpl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,12 @@ resource "google_container_cluster" "primary" {
549549
}
550550
}
551551
stack_type = var.stack_type
552+
dynamic "pod_cidr_overprovision_config" {
553+
for_each = var.pod_cidr_overprovision_config
554+
content {
555+
disabled = var.pod_cidr_overprovision_config.disabled
556+
}
557+
}
552558
}
553559

554560
maintenance_policy {
@@ -1034,6 +1040,13 @@ resource "google_container_node_pool" "windows_pools" {
10341040
enable_private_nodes = lookup(network_config.value, "enable_private_nodes", null)
10351041
{% endif %}
10361042

1043+
dynamic "pod_cidr_overprovision_config" {
1044+
for_each = lookup(network_config.value, "pod_cidr_overprovision_config", "") != "" ? [1] : []
1045+
content {
1046+
disabled = lookup(network_config.value, "pod_cidr_overprovision_config", null)
1047+
}
1048+
}
1049+
10371050
dynamic "network_performance_config" {
10381051
for_each = lookup(network_config.value, "total_egress_bandwidth_tier", "") != "" ? [1] : []
10391052
content {

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ variable "additional_pod_ranges_config" {
180180
default = []
181181
}
182182

183+
variable "pod_cidr_overprovision_config" {
184+
type = object({ disabled = bool })
185+
description = "Configuration for cluster level pod cidr overprovision."
186+
default = { disabled = null }
187+
}
188+
183189
variable "ip_range_services" {
184190
type = string
185191
description = "The _name_ of the secondary subnet range to use for services. If not provided, the default `34.118.224.0/20` range will be used."

cluster.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,12 @@ resource "google_container_cluster" "primary" {
419419
}
420420
}
421421
stack_type = var.stack_type
422+
dynamic "pod_cidr_overprovision_config" {
423+
for_each = var.pod_cidr_overprovision_config
424+
content {
425+
disabled = var.pod_cidr_overprovision_config.disabled
426+
}
427+
}
422428
}
423429

424430
maintenance_policy {
@@ -737,6 +743,13 @@ resource "google_container_node_pool" "pools" {
737743
pod_range = lookup(network_config.value, "pod_range", null)
738744
enable_private_nodes = lookup(network_config.value, "enable_private_nodes", null)
739745

746+
dynamic "pod_cidr_overprovision_config" {
747+
for_each = lookup(network_config.value, "pod_cidr_overprovision_config", "") != "" ? [1] : []
748+
content {
749+
disabled = lookup(network_config.value, "pod_cidr_overprovision_config", null)
750+
}
751+
}
752+
740753
dynamic "network_performance_config" {
741754
for_each = lookup(network_config.value, "total_egress_bandwidth_tier", "") != "" ? [1] : []
742755
content {
@@ -1103,6 +1116,13 @@ resource "google_container_node_pool" "windows_pools" {
11031116
pod_range = lookup(network_config.value, "pod_range", null)
11041117
enable_private_nodes = lookup(network_config.value, "enable_private_nodes", null)
11051118

1119+
dynamic "pod_cidr_overprovision_config" {
1120+
for_each = lookup(network_config.value, "pod_cidr_overprovision_config", "") != "" ? [1] : []
1121+
content {
1122+
disabled = lookup(network_config.value, "pod_cidr_overprovision_config", null)
1123+
}
1124+
}
1125+
11061126
dynamic "network_performance_config" {
11071127
for_each = lookup(network_config.value, "total_egress_bandwidth_tier", "") != "" ? [1] : []
11081128
content {

examples/gke_autopilot_cluster/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module "gke" {
3636
source = "terraform-google-modules/kubernetes-engine/google//modules/gke-autopilot-cluster"
3737
version = "~> 38.0"
3838

39-
project_id = var.project_id
39+
project_id = var.project_id
4040
name = "${local.cluster_type}-cluster"
4141
location = var.region
4242
network = module.gcp-network.network_self_link

examples/gke_standard_cluster/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module "gke" {
3737
source = "terraform-google-modules/kubernetes-engine/google//modules/gke-standard-cluster"
3838
version = "~> 38.0"
3939

40-
project_id = var.project_id
40+
project_id = var.project_id
4141
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
4242
location = var.region
4343
network = var.network
@@ -87,9 +87,9 @@ module "node_pool" {
8787
source = "terraform-google-modules/kubernetes-engine/google//modules/gke-node-pool"
8888
version = "~> 38.0"
8989

90-
project_id = var.project_id
91-
location = var.region
92-
cluster = module.gke.cluster_name
90+
project_id = var.project_id
91+
location = var.region
92+
cluster = module.gke.cluster_name
9393
node_config = {
9494
disk_size_gb = 100
9595
disk_type = "pd-standard"

examples/node_pool/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ module "gke" {
163163
}
164164

165165
node_pools_cgroup_mode = {
166-
all = "CGROUP_MODE_V2"
166+
all = "CGROUP_MODE_V2"
167167
pool-01 = "CGROUP_MODE_V1"
168168
}
169169

metadata.display.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,9 @@ spec:
363363
parallelstore_csi_driver:
364364
name: parallelstore_csi_driver
365365
title: Parallelstore Csi Driver
366+
pod_cidr_overprovision_config:
367+
name: pod_cidr_overprovision_config
368+
title: Pod Cidr Overprovision Config
366369
project_id:
367370
name: project_id
368371
title: Project Id

metadata.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,11 @@ spec:
263263
description: the configuration for individual additional subnetworks attached to the cluster
264264
varType: list(object({ subnetwork = string, pod_ipv4_range_names = list(string) }))
265265
defaultValue: []
266+
- name: pod_cidr_overprovision_config
267+
description: Configuration for cluster level pod cidr overprovision.
268+
varType: object({ disabled = bool })
269+
defaultValue:
270+
disabled: null
266271
- name: ip_range_services
267272
description: The _name_ of the secondary subnet range to use for services. If not provided, the default `34.118.224.0/20` range will be used.
268273
varType: string

0 commit comments

Comments
 (0)