Metadata fixes

This commit is contained in:
Serge Logvinov
2021-08-02 23:55:25 +03:00
parent fab1d06a05
commit 728e6f81f4
2 changed files with 38 additions and 10 deletions

View File

@@ -9,6 +9,12 @@ resource "google_compute_region_instance_group_manager" "web" {
version {
instance_template = google_compute_instance_template.web["all"].id
}
update_policy {
type = "OPPORTUNISTIC"
instance_redistribution_type = "PROACTIVE"
minimal_action = "REPLACE"
replacement_method = "SUBSTITUTE"
}
target_pools = []
target_size = lookup(var.instances["all"], "web_count", 0)
@@ -39,6 +45,12 @@ resource "google_compute_instance_group_manager" "web" {
version {
instance_template = google_compute_instance_template.web[each.key].id
}
update_policy {
type = "OPPORTUNISTIC"
minimal_action = "REPLACE"
max_unavailable_fixed = 1
replacement_method = "SUBSTITUTE"
}
named_port {
name = "http"
@@ -71,11 +83,13 @@ resource "google_compute_instance_template" "web" {
label = "web"
}
metadata_startup_script = templatefile("${path.module}/templates/worker.yaml.tpl",
merge(var.kubernetes, {
lbv4 = google_compute_address.lbv4_local.address
})
)
metadata = {
user-data = templatefile("${path.module}/templates/worker.yaml.tpl",
merge(var.kubernetes, {
lbv4 = google_compute_address.lbv4_local.address
})
)
}
disk {
boot = true

View File

@@ -9,6 +9,12 @@ resource "google_compute_region_instance_group_manager" "worker" {
version {
instance_template = google_compute_instance_template.worker["all"].id
}
update_policy {
type = "OPPORTUNISTIC"
instance_redistribution_type = "PROACTIVE"
minimal_action = "REPLACE"
replacement_method = "SUBSTITUTE"
}
target_pools = []
target_size = lookup(var.instances["all"], "worker_count", 0)
@@ -30,6 +36,12 @@ resource "google_compute_instance_group_manager" "worker" {
version {
instance_template = google_compute_instance_template.worker[each.key].id
}
update_policy {
type = "OPPORTUNISTIC"
minimal_action = "REPLACE"
max_unavailable_fixed = 1
replacement_method = "SUBSTITUTE"
}
target_pools = []
target_size = lookup(each.value, "worker_count", 0)
@@ -53,11 +65,13 @@ resource "google_compute_instance_template" "worker" {
label = "worker"
}
metadata_startup_script = templatefile("${path.module}/templates/worker.yaml.tpl",
merge(var.kubernetes, {
lbv4 = google_compute_address.lbv4_local.address
})
)
metadata = {
user-data = templatefile("${path.module}/templates/worker.yaml.tpl",
merge(var.kubernetes, {
lbv4 = google_compute_address.lbv4_local.address
})
)
}
disk {
boot = true