Skip to content

Commit 873d39e

Browse files
authored
feat: add network tier configuration (#2497)
1 parent 5f7d53c commit 873d39e

Some content is hidden

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

48 files changed

+245
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ Then perform the following commands on the root folder:
237237
| network\_policy\_provider | The network policy provider. | `string` | `"CALICO"` | no |
238238
| network\_project\_id | The project ID of the shared VPC's host (for shared vpc support) | `string` | `""` | no |
239239
| network\_tags | (Optional) - List of network tags applied to autopilot and auto-provisioned node pools. | `list(string)` | `[]` | no |
240+
| network\_tier\_config | Network tier configuration for the cluster | `string` | `null` | no |
240241
| node\_metadata | Specifies how node metadata is exposed to the workload running on the node | `string` | `"GKE_METADATA"` | no |
241242
| node\_pools | List of maps containing node pools | `list(map(any))` | <pre>[<br> {<br> "name": "default-node-pool"<br> }<br>]</pre> | no |
242243
| node\_pools\_cgroup\_mode | Map of strings containing cgroup node config by node-pool name | `map(string)` | <pre>{<br> "all": "",<br> "default-node-pool": ""<br>}</pre> | no |

autogen/main/cluster.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,12 @@ resource "google_container_cluster" "primary" {
567567
pod_ipv4_range_names = additional_ip_ranges_config.value.pod_ipv4_range_names
568568
}
569569
}
570+
dynamic "network_tier_config" {
571+
for_each = var.network_tier_config != null ? [1] : []
572+
content {
573+
network_tier = var.network_tier_config
574+
}
575+
}
570576
stack_type = var.stack_type
571577
}
572578

autogen/main/variables.tf.tmpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,3 +1246,13 @@ variable "rbac_binding_config" {
12461246
enable_insecure_binding_system_authenticated = null
12471247
}
12481248
}
1249+
1250+
variable "network_tier_config" {
1251+
description = "Network tier configuration for the cluster"
1252+
type = string
1253+
default = null
1254+
validation {
1255+
condition = var.network_tier_config == null ? true : contains(["NETWORK_TIER_DEFAULT", "NETWORK_TIER_STANDARD", "NETWORK_TIER_PREMIUM"], var.network_tier_config)
1256+
error_message = "Network tier allowed values are only NETWORK_TIER_DEFAULT, NETWORK_TIER_STANDARD or NETWORK_TIER_PREMIUM"
1257+
}
1258+
}

cluster.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,12 @@ resource "google_container_cluster" "primary" {
434434
pod_ipv4_range_names = additional_ip_ranges_config.value.pod_ipv4_range_names
435435
}
436436
}
437+
dynamic "network_tier_config" {
438+
for_each = var.network_tier_config != null ? [1] : []
439+
content {
440+
network_tier = var.network_tier_config
441+
}
442+
}
437443
stack_type = var.stack_type
438444
}
439445

metadata.display.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ spec:
285285
master_authorized_networks:
286286
name: master_authorized_networks
287287
title: Master Authorized Networks
288+
monitoring_auto_monitoring_config_scope:
289+
name: monitoring_auto_monitoring_config_scope
290+
title: Monitoring Auto Monitoring Config Scope
288291
monitoring_enable_managed_prometheus:
289292
name: monitoring_enable_managed_prometheus
290293
title: Monitoring Enable Managed Prometheus
@@ -321,6 +324,9 @@ spec:
321324
network_tags:
322325
name: network_tags
323326
title: Network Tags
327+
network_tier_config:
328+
name: network_tier_config
329+
title: Network Tier Config
324330
node_metadata:
325331
name: node_metadata
326332
title: Node Metadata

metadata.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,9 @@ spec:
806806
defaultValue:
807807
enable_insecure_binding_system_authenticated: null
808808
enable_insecure_binding_system_unauthenticated: null
809+
- name: network_tier_config
810+
description: Network tier configuration for the cluster
811+
varType: string
809812
outputs:
810813
- name: ca_certificate
811814
description: Cluster ca certificate (base64 encoded)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ Then perform the following commands on the root folder:
147147
| network | The VPC network to host the cluster in (required) | `string` | n/a | yes |
148148
| network\_project\_id | The project ID of the shared VPC's host (for shared vpc support) | `string` | `""` | no |
149149
| network\_tags | (Optional) - List of network tags applied to autopilot and auto-provisioned node pools. | `list(string)` | `[]` | no |
150+
| network\_tier\_config | Network tier configuration for the cluster | `string` | `null` | no |
150151
| node\_pools\_cgroup\_mode | Specifies the Linux cgroup mode for autopilot Kubernetes nodes in the cluster. Accepted values are `CGROUP_MODE_UNSPECIFIED`, `CGROUP_MODE_V1`, and `CGROUP_MODE_V2`, which determine the control group hierarchy used for resource management. | `string` | `null` | no |
151152
| notification\_config\_topic | The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}. | `string` | `""` | no |
152153
| 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 |

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,12 @@ resource "google_container_cluster" "primary" {
329329
pod_ipv4_range_names = additional_ip_ranges_config.value.pod_ipv4_range_names
330330
}
331331
}
332+
dynamic "network_tier_config" {
333+
for_each = var.network_tier_config != null ? [1] : []
334+
content {
335+
network_tier = var.network_tier_config
336+
}
337+
}
332338
stack_type = var.stack_type
333339
}
334340

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ spec:
262262
network_tags:
263263
name: network_tags
264264
title: Network Tags
265+
network_tier_config:
266+
name: network_tier_config
267+
title: Network Tier Config
265268
node_pools_cgroup_mode:
266269
name: node_pools_cgroup_mode
267270
title: Node Pools Cgroup Mode

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,9 @@ spec:
534534
defaultValue:
535535
enable_insecure_binding_system_authenticated: null
536536
enable_insecure_binding_system_unauthenticated: null
537+
- name: network_tier_config
538+
description: Network tier configuration for the cluster
539+
varType: string
537540
outputs:
538541
- name: ca_certificate
539542
description: Cluster ca certificate (base64 encoded)

0 commit comments

Comments
 (0)