Skip to content

Commit

Permalink
Force mt node pool create then destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
sjmiller609 committed Sep 30, 2019
1 parent 9d4a460 commit d65b477
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions node_pools.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ resource "google_container_node_pool" "node_pool_mt" {
version = data.google_container_cluster.primary.master_version

# We want the multi-tenant node pool to be completely replaced
# instead of rolling deployment. The timestamp in the name will
# dodge the naming collision with create_before_destroy = true, and
# the master_version will ensure that the node pool is created then
# instead of rolling deployment.
# The master_version will ensure that the node pool is created then
# destroyed if there is an update.
name = "${var.deployment_id}-mt-${replace(data.google_container_cluster.primary.master_version, ".", "-")}-${formatdate("MM-DD", timestamp())}"
name = "${var.deployment_id}-mt-${replace(data.google_container_cluster.primary.master_version, ".", "-")}"

# this one can take a long time to delete or create
timeouts {
Expand All @@ -31,9 +30,6 @@ resource "google_container_node_pool" "node_pool_mt" {

lifecycle {
create_before_destroy = true
# Ignoring changes on the name so that the create then destroy
# upgrade only occurs when something needs to happen
ignore_changes = [name]
}

location = var.zonal_cluster ? local.zone : local.region
Expand Down Expand Up @@ -119,7 +115,7 @@ resource "google_container_node_pool" "node_pool_platform" {

timeouts {
create = "30m"
update = "30m"
update = "45m"
delete = "30m"
}

Expand Down

0 comments on commit d65b477

Please sign in to comment.