From ed0b7812964b0ed151231bae53f29e4effeb2e34 Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Thu, 14 Jun 2018 22:43:01 -0700 Subject: [PATCH] Fix possible deadlock for provisioning bare-metal clusters * Closes #235 --- CHANGES.md | 6 +++++- bare-metal/container-linux/kubernetes/ssh.tf | 16 ++++++++++++++++ bare-metal/fedora-atomic/kubernetes/ssh.tf | 16 ++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 9dd9b576a..68ead1507 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,11 @@ Notable changes between versions. ## Latest -* Update etcd from v3.3.6 to v3.3.7 +* Update etcd from v3.3.6 to v3.3.7 ([#243](https://github.com/poseidon/typhoon/pull/243)) + +#### Bare-Metal + +* Fix possible deadlock when provisioning clusters larger than 10 nodes ([#244](https://github.com/poseidon/typhoon/pull/244)) #### Addons diff --git a/bare-metal/container-linux/kubernetes/ssh.tf b/bare-metal/container-linux/kubernetes/ssh.tf index d25538bf6..0b6220c0e 100644 --- a/bare-metal/container-linux/kubernetes/ssh.tf +++ b/bare-metal/container-linux/kubernetes/ssh.tf @@ -2,6 +2,14 @@ resource "null_resource" "copy-controller-secrets" { count = "${length(var.controller_names)}" + # Without depends_on, remote-exec could start and wait for machines before + # matchbox groups are written, causing a deadlock. + depends_on = [ + "matchbox_group.install", + "matchbox_group.controller", + "matchbox_group.worker", + ] + connection { type = "ssh" host = "${element(var.controller_domains, count.index)}" @@ -70,6 +78,14 @@ resource "null_resource" "copy-controller-secrets" { resource "null_resource" "copy-worker-secrets" { count = "${length(var.worker_names)}" + # Without depends_on, remote-exec could start and wait for machines before + # matchbox groups are written, causing a deadlock. + depends_on = [ + "matchbox_group.install", + "matchbox_group.controller", + "matchbox_group.worker", + ] + connection { type = "ssh" host = "${element(var.worker_domains, count.index)}" diff --git a/bare-metal/fedora-atomic/kubernetes/ssh.tf b/bare-metal/fedora-atomic/kubernetes/ssh.tf index 52c2231e7..f07871bf7 100644 --- a/bare-metal/fedora-atomic/kubernetes/ssh.tf +++ b/bare-metal/fedora-atomic/kubernetes/ssh.tf @@ -2,6 +2,14 @@ resource "null_resource" "copy-controller-secrets" { count = "${length(var.controller_names)}" + # Without depends_on, remote-exec could start and wait for machines before + # matchbox groups are written, causing a deadlock. + depends_on = [ + "matchbox_group.install", + "matchbox_group.controller", + "matchbox_group.worker", + ] + connection { type = "ssh" host = "${element(var.controller_domains, count.index)}" @@ -68,6 +76,14 @@ resource "null_resource" "copy-controller-secrets" { resource "null_resource" "copy-worker-secrets" { count = "${length(var.worker_names)}" + # Without depends_on, remote-exec could start and wait for machines before + # matchbox groups are written, causing a deadlock. + depends_on = [ + "matchbox_group.install", + "matchbox_group.controller", + "matchbox_group.worker", + ] + connection { type = "ssh" host = "${element(var.worker_domains, count.index)}"