mirror of
https://github.com/puppetmaster/typhoon.git
synced 2025-07-23 02:31:34 +02:00
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:
@ -45,6 +45,7 @@ resource "google_compute_instance" "controllers" {
|
||||
initialize_params {
|
||||
image = data.google_compute_image.flatcar-linux.self_link
|
||||
size = var.controller_disk_size
|
||||
type = var.controller_disk_type
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,6 +51,16 @@ variable "controller_disk_size" {
|
||||
default = 30
|
||||
}
|
||||
|
||||
variable "controller_disk_type" {
|
||||
type = string
|
||||
description = "Type of managed disk for controller node(s)"
|
||||
default = "pd-standard"
|
||||
validation {
|
||||
condition = contains(["pd-standard", "pd-ssd", "pd-balanced"], var.controller_disk_type)
|
||||
error_message = "The controller_disk_type must be pd-standard, pd-ssd or pd-balanced."
|
||||
}
|
||||
}
|
||||
|
||||
variable "worker_count" {
|
||||
type = number
|
||||
description = "Number of workers"
|
||||
@ -69,6 +79,16 @@ variable "worker_disk_size" {
|
||||
default = 30
|
||||
}
|
||||
|
||||
variable "worker_disk_type" {
|
||||
type = string
|
||||
description = "Type of managed disk for worker nodes"
|
||||
default = "pd-standard"
|
||||
validation {
|
||||
condition = contains(["pd-standard", "pd-ssd", "pd-balanced"], var.worker_disk_type)
|
||||
error_message = "The worker_disk_type must be pd-standard, pd-ssd or pd-balanced."
|
||||
}
|
||||
}
|
||||
|
||||
variable "worker_preemptible" {
|
||||
type = bool
|
||||
description = "If enabled, Compute Engine will terminate workers randomly within 24 hours"
|
||||
|
@ -10,6 +10,7 @@ module "workers" {
|
||||
machine_type = var.worker_type
|
||||
os_image = var.os_image
|
||||
disk_size = var.worker_disk_size
|
||||
disk_type = var.worker_disk_type
|
||||
preemptible = var.worker_preemptible
|
||||
|
||||
# configuration
|
||||
@ -19,4 +20,3 @@ module "workers" {
|
||||
snippets = var.worker_snippets
|
||||
node_labels = var.worker_node_labels
|
||||
}
|
||||
|
||||
|
@ -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"
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user