mirror of
https://github.com/puppetmaster/typhoon.git
synced 2025-07-18 01:11:34 +02:00
Change worker managed instance group to span zones in region
* Change Google Cloud module to require the `region` variable * Workers are created in random zones within the given region * Tolerate Google Cloud zone failures or capacity issues * If workers are preempted (if enabled), replacement instances can be drawn from any zone in the region, which should avoid scheduling issues that were possible before if a single zone aggressively preempts instances (presumably due to Google Cloud capacity)
This commit is contained in:
@ -20,9 +20,9 @@ variable "count" {
|
||||
description = "Number of worker compute instances the instance group should manage"
|
||||
}
|
||||
|
||||
variable "zone" {
|
||||
variable "region" {
|
||||
type = "string"
|
||||
description = "Google zone that compute instances in the group should be created in (e.g. gcloud compute zones list)"
|
||||
description = "Google Cloud region to create a regional managed group of workers (e.g. us-central1, see `gcloud compute regions list`)."
|
||||
}
|
||||
|
||||
variable "machine_type" {
|
||||
|
@ -1,16 +1,17 @@
|
||||
# Managed Instance Group
|
||||
resource "google_compute_instance_group_manager" "workers" {
|
||||
# Regional managed instance group maintains a homogeneous set of workers that
|
||||
# span the zones in the region.
|
||||
resource "google_compute_region_instance_group_manager" "workers" {
|
||||
name = "${var.cluster_name}-worker-group"
|
||||
description = "Compute instance group of ${var.cluster_name} workers"
|
||||
|
||||
# Instance name prefix for instances in the group
|
||||
# instance name prefix for instances in the group
|
||||
base_instance_name = "${var.cluster_name}-worker"
|
||||
instance_template = "${google_compute_instance_template.worker.self_link}"
|
||||
update_strategy = "RESTART"
|
||||
zone = "${var.zone}"
|
||||
target_size = "${var.count}"
|
||||
region = "${var.region}"
|
||||
|
||||
# Target pool instances in the group should be added into
|
||||
target_size = "${var.count}"
|
||||
|
||||
# target pool to which instances in the group should be added
|
||||
target_pools = [
|
||||
"${google_compute_target_pool.workers.self_link}",
|
||||
]
|
||||
|
Reference in New Issue
Block a user