Skip to content

Commit

Permalink
ranges and ipv6
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome committed Jan 17, 2025
1 parent aff1681 commit 68495cc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
7 changes: 6 additions & 1 deletion tests/tofu/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ resource "google_container_cluster" "primary" {
# private_endpoint_subnetwork = google_compute_subnetwork.subnet.self_link
master_ipv4_cidr_block = "172.16.0.0/28"
}
ip_allocation_policy {}
ip_allocation_policy {
stack_type = "IPV4_IPV6"
cluster_secondary_range_name = google_compute_subnetwork.subnet.secondary_ip_range.1.range_name
services_secondary_range_name = google_compute_subnetwork.subnet.secondary_ip_range.0.range_name
}
datapath_provider = "ADVANCED_DATAPATH"
}

resource "google_container_node_pool" "primary_nodes" {
Expand Down
19 changes: 18 additions & 1 deletion tests/tofu/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,30 @@ resource "google_compute_network" "vpc" {
name = "${var.gke_cluster_name}-vpc"
auto_create_subnetworks = "false"
project = data.google_client_config.current.project
enable_ula_internal_ipv6 = true
}

resource "google_compute_subnetwork" "subnet" {
name = "${var.gke_cluster_name}-subnet"
network = google_compute_network.vpc.self_link
ip_cidr_range = "10.10.0.0/24"
ip_cidr_range = "10.113.0.0/20"
private_ip_google_access = true
stack_type = "IPV4_IPV6"
ipv6_access_type = "INTERNAL"

secondary_ip_range {
ip_cidr_range = "10.201.0.0/16"
range_name = "subnet-services"
}

secondary_ip_range {
ip_cidr_range = "10.202.0.0/18"
range_name = "subnet-pods"
}

log_config {
metadata = "INCLUDE_ALL_METADATA"
}
}

resource "google_compute_router" "router" {
Expand Down

0 comments on commit 68495cc

Please sign in to comment.