File tree Expand file tree Collapse file tree 5 files changed +30
-13
lines changed
integration/node_pool/testdata Expand file tree Collapse file tree 5 files changed +30
-13
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ module "gke" {
6363
6464 additional_ip_ranges_config = [
6565 {
66- subnetwork = " projects/${ var . project_id } /regions/${ var . region } /subnetworks/${ var . subnetwork } "
66+ subnetwork = " projects/${ var . project_id } /regions/${ var . region } /subnetworks/${ var . additional_ip_pod_range_subnetwork } "
6767 pod_ipv4_range_names = [var.additional_ip_pod_range]
6868 }
6969 ]
Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ variable "ip_range_services" {
4848 description = " The secondary ip range to use for services"
4949}
5050
51+ variable "additional_ip_pod_range_subnetwork" {
52+ description = " The subnetwork to host the additional pod range in"
53+ }
54+
5155variable "additional_ip_pod_range" {
5256 description = " The secondary ip range to use for pods in the additional range"
5357}
Original file line number Diff line number Diff line change @@ -21,16 +21,17 @@ locals {
2121module "example" {
2222 source = " ../../../examples/node_pool"
2323
24- project_id = var. project_ids [0 ]
25- cluster_name_suffix = " -${ random_string . suffix . result } "
26- region = " europe-west4"
27- zones = [" europe-west4-b" ]
28- network = google_compute_network. main . name
29- subnetwork = google_compute_subnetwork. main . name
30- ip_range_pods = google_compute_subnetwork. main . secondary_ip_range [0 ]. range_name
31- ip_range_services = google_compute_subnetwork. main . secondary_ip_range [1 ]. range_name
32- additional_ip_pod_range = google_compute_subnetwork. main . secondary_ip_range [2 ]. range_name
33- compute_engine_service_account = local. compute_engine_service_account
24+ project_id = var. project_ids [0 ]
25+ cluster_name_suffix = " -${ random_string . suffix . result } "
26+ region = " europe-west4"
27+ zones = [" europe-west4-b" ]
28+ network = google_compute_network. main . name
29+ subnetwork = google_compute_subnetwork. main . name
30+ ip_range_pods = google_compute_subnetwork. main . secondary_ip_range [0 ]. range_name
31+ ip_range_services = google_compute_subnetwork. main . secondary_ip_range [1 ]. range_name
32+ additional_ip_pod_range_subnetwork = google_compute_subnetwork. secondary . name
33+ additional_ip_pod_range = google_compute_subnetwork. secondary . secondary_ip_range [0 ]. range_name
34+ compute_engine_service_account = local. compute_engine_service_account
3435
3536 cluster_autoscaling = {
3637 enabled = true
Original file line number Diff line number Diff line change @@ -50,3 +50,15 @@ resource "google_compute_subnetwork" "main" {
5050 ip_cidr_range = " 172.16.0.0/18"
5151 }
5252}
53+
54+ resource "google_compute_subnetwork" "secondary" {
55+ name = " cft-gke-test-2-${ random_string . suffix . result } "
56+ ip_cidr_range = " 10.1.0.0/17"
57+ region = " europe-west4"
58+ network = google_compute_network. main . self_link
59+
60+ secondary_ip_range {
61+ range_name = " test2"
62+ ip_cidr_range = " 172.18.0.0/18"
63+ }
64+ }
Original file line number Diff line number Diff line change 9393 "useIpAliases" : true ,
9494 "additionalIpRangesConfigs" : [
9595 {
96- "subnetwork" : " projects/PROJECT_ID/regions/europe-west4/subnetworks/cft-gke-test-RANDOM_STRING" ,
97- "podIpv4RangeNames" : [" test " ]
96+ "subnetwork" : " projects/PROJECT_ID/regions/europe-west4/subnetworks/cft-gke-test-2- RANDOM_STRING" ,
97+ "podIpv4RangeNames" : [" test2 " ]
9898 }
9999 ]
100100 },
You can’t perform that action at this time.
0 commit comments