google: Add controller_disk_type and worker_disk_type variables (#1513)

* Add controller_disk_type and worker_disk_type variables
* Properly pass disk_type to worker nodes
This commit is contained in:
Jordan Pittier
2024-09-20 23:31:17 +02:00
committed by GitHub
parent b2fad7771f
commit 3f844e3c57
13 changed files with 104 additions and 38 deletions

View File

@ -51,6 +51,16 @@ variable "disk_size" {
default = 30
}
variable "disk_type" {
type = string
description = "Type of managed disk"
default = "pd-standard"
validation {
condition = contains(["pd-standard", "pd-ssd", "pd-balanced"], var.disk_type)
error_message = "The disk_type must be pd-standard, pd-ssd or pd-balanced."
}
}
variable "preemptible" {
type = bool
description = "If enabled, Compute Engine will terminate instances randomly within 24 hours"
@ -109,4 +119,3 @@ variable "accelerator_count" {
default = "0"
description = "Number of compute engine accelerators"
}

View File

@ -80,6 +80,7 @@ resource "google_compute_region_instance_template" "worker" {
boot = true
source_image = data.google_compute_image.flatcar-linux.self_link
disk_size_gb = var.disk_size
disk_type = var.disk_type
}
network_interface {