Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add remove_default_node_pool #55

Merged
merged 7 commits into from
Jan 5, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ Then perform the following commands on the root folder:
| network | The VPC network to host the cluster in (required) | string | - | yes |
| network_policy | Enable network policy addon | string | `false` | no |
| network_project_id | The project ID of the shared VPC's host (for shared vpc support) | string | `` | no |
| remove_default_node_pool | Boolean value determining removal of default node pool | bool | false | no |
| node_pools | List of maps containing node pools | list | `<list>` | no |
| node_pools_labels | Map of maps containing node labels by node-pool name | map | `<map>` | no |
| node_pools_tags | Map of lists containing node network tags by node-pool name | map | `<map>` | no |
Expand Down
6 changes: 4 additions & 2 deletions cluster_regional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ resource "google_container_cluster" "primary" {
region = "${var.region}"
additional_zones = ["${coalescelist(compact(var.zones), sort(random_shuffle.available_zones.result))}"]

network = "${data.google_compute_network.gke_network.self_link}"
subnetwork = "${data.google_compute_subnetwork.gke_subnetwork.self_link}"
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"
subnetwork = "${replace(data.google_compute_subnetwork.gke_subnetwork.self_link, "https://www.googleapis.com/compute/v1/", "")}"
min_master_version = "${local.kubernetes_version}"

logging_service = "${var.logging_service}"
Expand Down Expand Up @@ -81,6 +81,8 @@ resource "google_container_cluster" "primary" {
service_account = "${lookup(var.node_pools[0], "service_account", var.service_account)}"
}
}

remove_default_node_pool = "${var.remove_default_node_pool}"
}

/******************************************
Expand Down
6 changes: 4 additions & 2 deletions cluster_zonal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ resource "google_container_cluster" "zonal_primary" {
zone = "${var.zones[0]}"
additional_zones = ["${slice(var.zones,1,length(var.zones))}"]

network = "${data.google_compute_network.gke_network.self_link}"
subnetwork = "${data.google_compute_subnetwork.gke_subnetwork.self_link}"
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"
subnetwork = "${replace(data.google_compute_subnetwork.gke_subnetwork.self_link, "https://www.googleapis.com/compute/v1/", "")}"
min_master_version = "${local.kubernetes_version}"

logging_service = "${var.logging_service}"
Expand Down Expand Up @@ -81,6 +81,8 @@ resource "google_container_cluster" "zonal_primary" {
service_account = "${lookup(var.node_pools[0], "service_account", var.service_account)}"
}
}

remove_default_node_pool = "${var.remove_default_node_pool}"
}

/******************************************
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ variable "ip_range_services" {
description = "The secondary ip range to use for pods"
}

variable "remove_default_node_pool" {
description = "Remove default node pool while setting up the cluster"
default = false
}

variable "node_pools" {
type = "list"
description = "List of maps containing node pools"
Expand Down