From 81706207fc8bac5b8c4649e8468617127f2a83f1 Mon Sep 17 00:00:00 2001 From: rmakram-ims <43446736+rmakram-ims@users.noreply.github.com> Date: Tue, 4 Dec 2018 03:17:27 -0500 Subject: [PATCH] Add wait_nodes_max_tries to wait for nodes to be available before applying the kubernetes configurations (#187) * Add wait_nodes_max_tries to wait for nodes to be available before applying the kubernetes configurations * Format variables.tf and aws_auth.tf * Fix template expansion for wait-nodes-ready.tpl * Ensuring that kubeconfig is created before its use * Cleanup wait-nodes-ready script * Simplify logic to retry application of kubernetes config if failed * Revert file permission change --- CHANGELOG.md | 1 + aws_auth.tf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e61ba6f..fb40704 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ project adheres to [Semantic Versioning](http://semver.org/). - `suspended_processes` to `worker_groups` input (by @bkmeneguello) - `target_group_arns` to `worker_groups` input (by @zihaoyu) - `force_detach_policies` to `aws_iam_role` `cluster` and `workers` (by @marky-mark) +- Added sleep while trying to apply the kubernetes configurations if failed, up to 50 seconds (by @rmakram-ims) ### Changed diff --git a/aws_auth.tf b/aws_auth.tf index 0c898d1..0d31254 100644 --- a/aws_auth.tf +++ b/aws_auth.tf @@ -8,7 +8,7 @@ resource "null_resource" "update_config_map_aws_auth" { depends_on = ["aws_eks_cluster.this"] provisioner "local-exec" { - command = "kubectl apply -f ${var.config_output_path}config-map-aws-auth_${var.cluster_name}.yaml --kubeconfig ${var.config_output_path}kubeconfig_${var.cluster_name}" + command = "for i in {1..5}; do kubectl apply -f ${var.config_output_path}config-map-aws-auth_${var.cluster_name}.yaml --kubeconfig ${var.config_output_path}kubeconfig_${var.cluster_name} && break || sleep 10; done" } triggers {