Skip to content

Commit 2a89a5c

Browse files
Enable IPv6 settings on Cluster
Exposed `ip_allocation_policy.stack_type` and `private_ipv6_google_access`. All optional, no changes to default behavior.
1 parent 716a764 commit 2a89a5c

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

tf/service_cluster/container.tf

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ resource "google_container_cluster" "main" {
2020
location = local.location
2121
network = var.network.name
2222
subnetwork = var.subnetwork.name
23+
2324
ip_allocation_policy {
25+
stack_type = var.ip_allocation_policy == null ? null : var.ip_allocation_policy.stack_type
2426
}
25-
2627
dynamic "node_pool_auto_config" {
2728
# terraform would detect false changes if the add_node_pool_network_tags is empty
2829
# this will prevent this behavior
@@ -56,6 +57,7 @@ resource "google_container_cluster" "main" {
5657
workload_vulnerability_mode = "BASIC"
5758
}
5859

60+
private_ipv6_google_access = var.private_ipv6_google_access
5961

6062
lifecycle {
6163
ignore_changes = [

tf/service_cluster/variables.tf

+19-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ Supported values include: `SYSTEM_COMPONENTS`, `APISERVER`, `SCHEDULER`, `CONTRO
2626
EOF
2727
}
2828

29+
variable "ip_allocation_policy" {
30+
description = "Configuration of cluster IP allocation for VPC-native clusters."
31+
type = object({
32+
stack_type = string
33+
})
34+
default = null
35+
nullable = true
36+
}
37+
2938
variable "master_cidr_block" {
3039
type = string
3140
}
@@ -41,6 +50,16 @@ variable "network" {
4150
})
4251
}
4352

53+
variable "private_ipv6_google_access" {
54+
description = <<EOF
55+
The desired state of IPv6 connectivity to Google Services.
56+
By default, no private IPv6 access to or from Google Services (all access will be via IPv4).
57+
EOF
58+
type = string
59+
nullable = true
60+
default = null
61+
}
62+
4463
variable "release_channel_name" {
4564
type = string
4665
default = "STABLE"
@@ -51,4 +70,3 @@ variable "subnetwork" {
5170
name = string
5271
})
5372
}
54-

0 commit comments

Comments
 (0)