From 27e02b1b085f22fe6ca70062a19582acdca7c9f9 Mon Sep 17 00:00:00 2001 From: upodroid Date: Tue, 5 Mar 2024 20:25:40 +0000 Subject: [PATCH] switch to N2 machine types --- .../terraform/k8s-infra-prow-build/main.tf | 5 +++-- .../terraform/k8s-infra-public-pii/main.tf | 2 +- .../terraform/modules/gke-nodepool/main.tf | 21 ++++++++++--------- .../modules/gke-nodepool/variables.tf | 6 ++++++ 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/infra/gcp/terraform/k8s-infra-prow-build/main.tf b/infra/gcp/terraform/k8s-infra-prow-build/main.tf index 69a78671b405..31c670454ce9 100644 --- a/infra/gcp/terraform/k8s-infra-prow-build/main.tf +++ b/infra/gcp/terraform/k8s-infra-prow-build/main.tf @@ -88,12 +88,13 @@ module "prow_build_nodepool_n1_highmem_8_localssd" { project_name = module.project.project_id cluster_name = module.prow_build_cluster.cluster.name location = module.prow_build_cluster.cluster.location - name = "pool5" + name = "pool6" initial_count = 1 min_count = 1 max_count = 80 image_type = "UBUNTU_CONTAINERD" - machine_type = "n1-highmem-8" + machine_type = "n2-custom-10-65536" // 10vCPU, 64GB of memory + min_cpu_platform = "Intel Ice Lake" disk_size_gb = 100 disk_type = "pd-standard" ephemeral_local_ssd_count = 2 # each is 375GB diff --git a/infra/gcp/terraform/k8s-infra-public-pii/main.tf b/infra/gcp/terraform/k8s-infra-public-pii/main.tf index 5e2e023160a2..10f3f6d90bc7 100644 --- a/infra/gcp/terraform/k8s-infra-public-pii/main.tf +++ b/infra/gcp/terraform/k8s-infra-public-pii/main.tf @@ -183,5 +183,5 @@ resource "google_project_iam_member" "pii_access" { for_each = toset(["roles/viewer", "roles/bigquery.user"]) project = local.project_id role = each.key - member = "k8s-infra-public-pii@kubernetes.io" + member = "group:k8s-infra-public-pii@kubernetes.io" } diff --git a/infra/gcp/terraform/modules/gke-nodepool/main.tf b/infra/gcp/terraform/modules/gke-nodepool/main.tf index 70c91d806df4..37530242e375 100644 --- a/infra/gcp/terraform/modules/gke-nodepool/main.tf +++ b/infra/gcp/terraform/modules/gke-nodepool/main.tf @@ -21,9 +21,9 @@ resource "google_container_node_pool" "node_pool" { // name = var.name name_prefix = "${var.name}-" - project = var.project_name - location = var.location - cluster = var.cluster_name + project = var.project_name + location = var.location + cluster = var.cluster_name // Auto repair, and auto upgrade nodes to match the master version management { @@ -40,18 +40,19 @@ resource "google_container_node_pool" "node_pool" { // Set machine type, and enable all oauth scopes tied to the service account node_config { - image_type = var.image_type - machine_type = var.machine_type - disk_size_gb = var.disk_size_gb - disk_type = var.disk_type - labels = var.labels - taint = var.taints + image_type = var.image_type + machine_type = var.machine_type + disk_size_gb = var.disk_size_gb + disk_type = var.disk_type + labels = var.labels + taint = var.taints + min_cpu_platform = var.min_cpu_platform service_account = var.service_account oauth_scopes = ["https://www.googleapis.com/auth/cloud-platform"] dynamic "ephemeral_storage_config" { - for_each = var.ephemeral_local_ssd_count > 0 ? [var.ephemeral_local_ssd_count] : [] + for_each = var.ephemeral_local_ssd_count > 0 ? [var.ephemeral_local_ssd_count] : [] content { local_ssd_count = ephemeral_storage_config.value } diff --git a/infra/gcp/terraform/modules/gke-nodepool/variables.tf b/infra/gcp/terraform/modules/gke-nodepool/variables.tf index 4064dc04f4c7..32c0d4830e0c 100644 --- a/infra/gcp/terraform/modules/gke-nodepool/variables.tf +++ b/infra/gcp/terraform/modules/gke-nodepool/variables.tf @@ -101,3 +101,9 @@ variable "service_account" { description = "The email address of the GCP Service Account to be associated with nodes in this node_pool" type = string } + +variable "min_cpu_platform" { + description = "Minimum CPU Platform to use for instances" + type = string + default = null +}