Skip to content

Commit b45ec59

Browse files
committed
Fine-tuned cluster creation logic
Signed-off-by: Philip Schmid <phisch@cisco.com>
1 parent 6b55a1d commit b45ec59

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

02-infra.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ module "elb_k8s_elb" {
8888

8989
health_check = {
9090
target = "tcp:50000"
91-
interval = 30
92-
healthy_threshold = 2
91+
interval = 5
92+
healthy_threshold = 3
9393
unhealthy_threshold = 2
94-
timeout = 5
94+
timeout = 2
9595
}
9696

9797
number_of_instances = var.controlplane_count

03-talos.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,15 @@ resource "talos_machine_configuration_apply" "controlplane" {
216216
node = var.use_private_ips_only ? module.talos_control_plane_nodes[each.key].private_ip : module.talos_control_plane_nodes[each.key].public_ip
217217
}
218218

219+
# Wait until Talos APID has rotated its cert & ELB sees the node healthy
220+
resource "time_sleep" "wait_api_ready" {
221+
depends_on = [talos_machine_bootstrap.this]
222+
create_duration = "30s"
223+
}
224+
219225
resource "talos_machine_configuration_apply" "worker_group" {
226+
depends_on = [time_sleep.wait_api_ready]
227+
220228
for_each = merge([for info in var.worker_groups : { for index in range(0, var.workers_count) : "${info.name}.${index}" => info }]...)
221229

222230
client_configuration = talos_machine_secrets.this.client_configuration

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ module "talos" {
6161
| <a name="provider_null"></a> [null](#provider\_null) | n/a |
6262
| <a name="provider_random"></a> [random](#provider\_random) | ~> 3.7 |
6363
| <a name="provider_talos"></a> [talos](#provider\_talos) | 0.9.0-alpha.0 |
64+
| <a name="provider_time"></a> [time](#provider\_time) | n/a |
6465

6566
### Modules
6667

@@ -87,6 +88,7 @@ module "talos" {
8788
| [talos_machine_configuration_apply.controlplane](https://registry.terraform.io/providers/siderolabs/talos/0.9.0-alpha.0/docs/resources/machine_configuration_apply) | resource |
8889
| [talos_machine_configuration_apply.worker_group](https://registry.terraform.io/providers/siderolabs/talos/0.9.0-alpha.0/docs/resources/machine_configuration_apply) | resource |
8990
| [talos_machine_secrets.this](https://registry.terraform.io/providers/siderolabs/talos/0.9.0-alpha.0/docs/resources/machine_secrets) | resource |
91+
| [time_sleep.wait_api_ready](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
9092
| [aws_ami.talos](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ami) | data source |
9193
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |
9294
| [aws_subnets.private](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/subnets) | data source |

0 commit comments

Comments
 (0)