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 0c9fd64
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 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

0 comments on commit 0c9fd64

Please sign in to comment.