Skip to content

Commit 68495cc

Browse files
committed
ranges and ipv6
1 parent aff1681 commit 68495cc

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

tests/tofu/main.tf

+6-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ resource "google_container_cluster" "primary" {
5858
# private_endpoint_subnetwork = google_compute_subnetwork.subnet.self_link
5959
master_ipv4_cidr_block = "172.16.0.0/28"
6060
}
61-
ip_allocation_policy {}
61+
ip_allocation_policy {
62+
stack_type = "IPV4_IPV6"
63+
cluster_secondary_range_name = google_compute_subnetwork.subnet.secondary_ip_range.1.range_name
64+
services_secondary_range_name = google_compute_subnetwork.subnet.secondary_ip_range.0.range_name
65+
}
66+
datapath_provider = "ADVANCED_DATAPATH"
6267
}
6368

6469
resource "google_container_node_pool" "primary_nodes" {

tests/tofu/network.tf

+18-1
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,30 @@ resource "google_compute_network" "vpc" {
22
name = "${var.gke_cluster_name}-vpc"
33
auto_create_subnetworks = "false"
44
project = data.google_client_config.current.project
5+
enable_ula_internal_ipv6 = true
56
}
67

78
resource "google_compute_subnetwork" "subnet" {
89
name = "${var.gke_cluster_name}-subnet"
910
network = google_compute_network.vpc.self_link
10-
ip_cidr_range = "10.10.0.0/24"
11+
ip_cidr_range = "10.113.0.0/20"
1112
private_ip_google_access = true
13+
stack_type = "IPV4_IPV6"
14+
ipv6_access_type = "INTERNAL"
15+
16+
secondary_ip_range {
17+
ip_cidr_range = "10.201.0.0/16"
18+
range_name = "subnet-services"
19+
}
20+
21+
secondary_ip_range {
22+
ip_cidr_range = "10.202.0.0/18"
23+
range_name = "subnet-pods"
24+
}
25+
26+
log_config {
27+
metadata = "INCLUDE_ALL_METADATA"
28+
}
1229
}
1330

1431
resource "google_compute_router" "router" {

0 commit comments

Comments
 (0)