From 68716cca1f6567d0e8bff01f45c39ff5564f48dc Mon Sep 17 00:00:00 2001 From: Alex Ouzounis Date: Fri, 28 Feb 2020 14:46:42 +0000 Subject: [PATCH] feat: remove un needed node pool (#23) --- main.tf | 23 ++++++++++++++++------- variables.tf | 5 ----- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/main.tf b/main.tf index e7f868d..9de4089 100644 --- a/main.tf +++ b/main.tf @@ -28,8 +28,8 @@ resource "google_project_service" "project" { ## Modules module "gke-cluster" { - source = "github.com/ouzi-dev/gke-terraform.git?ref=v0.6.0" - # source = "../gke-terraform" + source = "github.com/ouzi-dev/gke-terraform.git?ref=v0.6.1" + #source = "../gke-terraform" region = var.gcloud_region project = var.gcloud_project @@ -48,7 +48,6 @@ module "gke-cluster" { kubernetes_version = var.gke_kubernetes_version machine_type = var.gke_machine_type - big_machine_type = var.gke_big_machine_type machine_disk_size = var.gke_machine_disk_size machine_is_preemptible = var.gke_machine_is_preemptible min_nodes = var.gke_min_nodes @@ -72,7 +71,7 @@ locals { } module "image-build-workers" { - source = "github.com/ouzi-dev/gke-terraform.git//modules/gke-workers?ref=v0.5.2" + source = "github.com/ouzi-dev/gke-terraform.git//modules/gke-workers?ref=v0.6.1" #source = "../gke-terraform/modules/gke-workers" region = var.gcloud_region @@ -156,9 +155,19 @@ resource "google_service_account" "preemptible_killer" { } ### Set IAM for preemptible-killer to zap nodes -resource "google_project_iam_member" "preemptible_killer" { - role = "compute.instances.delete" - member = "serviceAccount:${google_service_account.preemptible_killer.email}" +resource "google_project_iam_binding" "preemptible_killer_compute_admin" { + role = "roles/compute.admin" + members = [ + "serviceAccount:${google_service_account.preemptible_killer.email}", + ] +} + +### Set IAM for preemptible-killer to zap nodes +resource "google_project_iam_binding" "preemptible_killer_container_admin" { + role = "roles/container.admin" + members = [ + "serviceAccount:${google_service_account.preemptible_killer.email}", + ] } ### Key for the Preemptible killer Service Account diff --git a/variables.tf b/variables.tf index c85ca7e..d4b9718 100644 --- a/variables.tf +++ b/variables.tf @@ -64,11 +64,6 @@ variable "gke_kubernetes_version" { variable "gke_machine_type" { description = "Instance type for the primary pool of workers" - default = "n2-standard-2" -} - -variable "gke_big_machine_type" { - description = "Instance type for the beefier pool of workers" default = "n2-standard-4" }