From ac5838c42524db39f6c5ff183c2a486ba675076b Mon Sep 17 00:00:00 2001 From: Philipp Strube Date: Tue, 17 Aug 2021 18:14:04 +0200 Subject: [PATCH 1/2] Add variable to configure taints on node pool module --- google/_modules/gke/node_pool/main.tf | 3 ++- google/_modules/gke/node_pool/variables.tf | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/google/_modules/gke/node_pool/main.tf b/google/_modules/gke/node_pool/main.tf index b3bc6ce4..7ff654fb 100644 --- a/google/_modules/gke/node_pool/main.tf +++ b/google/_modules/gke/node_pool/main.tf @@ -33,6 +33,8 @@ resource "google_container_node_pool" "current" { workload_metadata_config { node_metadata = var.node_workload_metadata_config } + + taint = var.taint } management { @@ -40,4 +42,3 @@ resource "google_container_node_pool" "current" { auto_upgrade = var.auto_upgrade } } - diff --git a/google/_modules/gke/node_pool/variables.tf b/google/_modules/gke/node_pool/variables.tf index 34c0c092..7b272946 100644 --- a/google/_modules/gke/node_pool/variables.tf +++ b/google/_modules/gke/node_pool/variables.tf @@ -101,3 +101,9 @@ variable "node_workload_metadata_config" { description = "How to expose the node metadata to the workload running on the node." type = string } + +variable "taint" { + description = "Taints to configure for the node pool." + type = list(any) + default = [] +} From 26a7f05a929ae01c78352026bc64cea2d14e2a00 Mon Sep 17 00:00:00 2001 From: Philipp Strube Date: Tue, 17 Aug 2021 19:18:49 +0200 Subject: [PATCH 2/2] Allow having a node pool's node locations differ from the cluster --- google/_modules/gke/node_pool/main.tf | 2 ++ google/_modules/gke/node_pool/variables.tf | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/google/_modules/gke/node_pool/main.tf b/google/_modules/gke/node_pool/main.tf index 7ff654fb..631025d7 100644 --- a/google/_modules/gke/node_pool/main.tf +++ b/google/_modules/gke/node_pool/main.tf @@ -11,6 +11,8 @@ resource "google_container_node_pool" "current" { max_node_count = var.max_node_count } + node_locations = var.node_locations + # # # Node config diff --git a/google/_modules/gke/node_pool/variables.tf b/google/_modules/gke/node_pool/variables.tf index 7b272946..4e2cbb0f 100644 --- a/google/_modules/gke/node_pool/variables.tf +++ b/google/_modules/gke/node_pool/variables.tf @@ -107,3 +107,9 @@ variable "taint" { type = list(any) default = [] } + +variable "node_locations" { + type = list(string) + description = "List of zones in the cluster's region to start worker nodes in. Defaults to cluster's node locations." + default = null +}