Move from a single zone to multiple zones to increase spot instance availability

This commit is contained in:
E M 2026-04-30 17:59:36 +10:00
parent c889c0283f
commit 2872a2800f
No known key found for this signature in database
3 changed files with 8 additions and 0 deletions

View File

@ -20,6 +20,7 @@ module "gke" {
tests_pool_name = "tests-e2-medium"
tests_pool_machine_type = "e2-medium"
tests_pool_max = 5
tests_pool_zones = ["europe-west4-a", "europe-west4-b", "europe-west4-c"]
tests_pool_labels = {
default-pool = "false"
scaling-type = "auto"

View File

@ -39,6 +39,7 @@ resource "google_container_cluster" "this" {
node_pool {
name = var.tests_pool_name
initial_node_count = 0
node_locations = length(var.tests_pool_zones) > 0 ? var.tests_pool_zones : null
autoscaling {
min_node_count = 0

View File

@ -70,3 +70,9 @@ variable "tests_pool_labels" {
description = "Kubernetes labels to apply to nodes in the tests pool."
default = {}
}
variable "tests_pool_zones" {
type = list(string)
description = "Zones for the tests node pool. Spanning multiple zones increases spot instance availability."
default = []
}