File tree Expand file tree Collapse file tree 4 files changed +14
-4
lines changed Expand file tree Collapse file tree 4 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ Then perform the following commands on the root folder:
106
106
| network | The VPC network to host the cluster in (required) | string | - | yes |
107
107
| network_policy | Enable network policy addon | string | ` false ` | no |
108
108
| network_project_id | The project ID of the shared VPC's host (for shared vpc support) | string | `` | no |
109
+ | remove_default_node_pool | Boolean value determining removal of default node pool | bool | false | no |
109
110
| node_pools | List of maps containing node pools | list | ` <list> ` | no |
110
111
| node_pools_labels | Map of maps containing node labels by node-pool name | map | ` <map> ` | no |
111
112
| node_pools_tags | Map of lists containing node network tags by node-pool name | map | ` <map> ` | no |
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ resource "google_container_cluster" "primary" {
26
26
region = " ${ var . region } "
27
27
additional_zones = [" ${ coalescelist (compact (var. zones ), sort (random_shuffle. available_zones . result ))} " ]
28
28
29
- network = " ${ data . google_compute_network . gke_network . self_link } "
30
- subnetwork = " ${ data . google_compute_subnetwork . gke_subnetwork . self_link } "
29
+ network = " ${ replace ( data. google_compute_network . gke_network . self_link , " https://www.googleapis.com/compute/v1/ " , " " ) } "
30
+ subnetwork = " ${ replace ( data. google_compute_subnetwork . gke_subnetwork . self_link , " https://www.googleapis.com/compute/v1/ " , " " ) } "
31
31
min_master_version = " ${ local . kubernetes_version } "
32
32
33
33
logging_service = " ${ var . logging_service } "
@@ -81,6 +81,8 @@ resource "google_container_cluster" "primary" {
81
81
service_account = " ${ lookup (var. node_pools [0 ], " service_account" , var. service_account )} "
82
82
}
83
83
}
84
+
85
+ remove_default_node_pool = " ${ var . remove_default_node_pool } "
84
86
}
85
87
86
88
/* *****************************************
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ resource "google_container_cluster" "zonal_primary" {
26
26
zone = " ${ var . zones [0 ]} "
27
27
additional_zones = [" ${ slice (var. zones ,1 ,length (var. zones ))} " ]
28
28
29
- network = " ${ data . google_compute_network . gke_network . self_link } "
30
- subnetwork = " ${ data . google_compute_subnetwork . gke_subnetwork . self_link } "
29
+ network = " ${ replace ( data. google_compute_network . gke_network . self_link , " https://www.googleapis.com/compute/v1/ " , " " ) } "
30
+ subnetwork = " ${ replace ( data. google_compute_subnetwork . gke_subnetwork . self_link , " https://www.googleapis.com/compute/v1/ " , " " ) } "
31
31
min_master_version = " ${ local . kubernetes_version } "
32
32
33
33
logging_service = " ${ var . logging_service } "
@@ -81,6 +81,8 @@ resource "google_container_cluster" "zonal_primary" {
81
81
service_account = " ${ lookup (var. node_pools [0 ], " service_account" , var. service_account )} "
82
82
}
83
83
}
84
+
85
+ remove_default_node_pool = " ${ var . remove_default_node_pool } "
84
86
}
85
87
86
88
/* *****************************************
Original file line number Diff line number Diff line change @@ -117,6 +117,11 @@ variable "ip_range_services" {
117
117
description = " The secondary ip range to use for pods"
118
118
}
119
119
120
+ variable "remove_default_node_pool" {
121
+ description = " Remove default node pool while setting up the cluster"
122
+ default = false
123
+ }
124
+
120
125
variable "node_pools" {
121
126
type = " list"
122
127
description = " List of maps containing node pools"
You can’t perform that action at this time.
0 commit comments