terraform/gcp: Allow to use preemptible VM instances (#8480)

This commit is contained in:
Mathieu Parent
2022-01-31 09:30:24 +01:00
committed by GitHub
parent ababcd5481
commit 3562d3378b
5 changed files with 38 additions and 4 deletions

View File

@@ -231,6 +231,11 @@ resource "google_compute_instance" "master" {
lifecycle {
ignore_changes = [attached_disk]
}
scheduling {
preemptible = var.master_preemptible
automatic_restart = !var.master_preemptible
}
}
resource "google_compute_forwarding_rule" "master_lb" {
@@ -328,6 +333,11 @@ resource "google_compute_instance" "worker" {
lifecycle {
ignore_changes = [attached_disk]
}
scheduling {
preemptible = var.worker_preemptible
automatic_restart = !var.worker_preemptible
}
}
resource "google_compute_address" "worker_lb" {