From 38cf8cf8ce8687550dbb05f42cbaab1773221aa9 Mon Sep 17 00:00:00 2001 From: Uche Madu Date: Mon, 23 Oct 2023 08:51:48 +0100 Subject: [PATCH 1/2] fix gke --- terraform/gke.tf | 4 ++-- terraform/terraform.tfvars | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/terraform/gke.tf b/terraform/gke.tf index ba309d8..2503abd 100644 --- a/terraform/gke.tf +++ b/terraform/gke.tf @@ -26,6 +26,7 @@ module "gke" { ip_range_pods = "deb-sub1-secondary-gke-pods" ip_range_services = "deb-sub1-secondary-gke-services" grant_registry_access = true + remove_default_node_pool = true cluster_autoscaling = { "auto_repair" : true, @@ -44,7 +45,6 @@ module "gke" { { name = var.node_pool_name machine_type = var.machine_type - node_locations = var.zone #join(",", random_shuffle.zones.result) min_count = 1 max_count = 3 disk_size_gb = 32 @@ -52,7 +52,7 @@ module "gke" { image_type = "COS_CONTAINERD" service_account = data.google_service_account.deb-sa.email preemptible = false - initial_node_count = var.node_count + max_unavailable = 1 }, ] diff --git a/terraform/terraform.tfvars b/terraform/terraform.tfvars index 6502bc6..0079b88 100644 --- a/terraform/terraform.tfvars +++ b/terraform/terraform.tfvars @@ -11,7 +11,7 @@ subnet-01 = "deb-sub1" # GKE gke_cluster = "deb-airflow-cluster" node_pool_name = "deb-node-pool" -machine_type = "n2-standard-2" +machine_type = "n2-standard-4" node_count = 3 airflow-gke-workload-identity = "airflow-workload-identity" From 4dd4c8f22792e86121ce66042df56c7e0c171634 Mon Sep 17 00:00:00 2001 From: Uche Madu Date: Mon, 23 Oct 2023 08:53:02 +0100 Subject: [PATCH 2/2] fix gke --- terraform/gke.tf | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/terraform/gke.tf b/terraform/gke.tf index 2503abd..3fd3a4d 100644 --- a/terraform/gke.tf +++ b/terraform/gke.tf @@ -17,15 +17,15 @@ module "gke" { source = "terraform-google-modules/kubernetes-engine/google" version = "~> 28.0.0" - project_id = module.vpc.project_id - name = "${var.gke_cluster}-${random_id.suffix.hex}" - region = var.region - zones = [var.zone] - network = module.vpc.network_name - subnetwork = module.vpc.subnets_names[0] - ip_range_pods = "deb-sub1-secondary-gke-pods" - ip_range_services = "deb-sub1-secondary-gke-services" - grant_registry_access = true + project_id = module.vpc.project_id + name = "${var.gke_cluster}-${random_id.suffix.hex}" + region = var.region + zones = [var.zone] + network = module.vpc.network_name + subnetwork = module.vpc.subnets_names[0] + ip_range_pods = "deb-sub1-secondary-gke-pods" + ip_range_services = "deb-sub1-secondary-gke-services" + grant_registry_access = true remove_default_node_pool = true cluster_autoscaling = { @@ -43,15 +43,15 @@ module "gke" { node_pools = [ { - name = var.node_pool_name - machine_type = var.machine_type - min_count = 1 - max_count = 3 - disk_size_gb = 32 - disk_type = "pd-standard" - image_type = "COS_CONTAINERD" - service_account = data.google_service_account.deb-sa.email - preemptible = false + name = var.node_pool_name + machine_type = var.machine_type + min_count = 1 + max_count = 3 + disk_size_gb = 32 + disk_type = "pd-standard" + image_type = "COS_CONTAINERD" + service_account = data.google_service_account.deb-sa.email + preemptible = false max_unavailable = 1 }, ]