hashicorp / learn-terraform-provision-eks-cluster

https://developer.hashicorp.com/terraform/tutorials/kubernetes/eks
Mozilla Public License 2.0
397 stars 1.2k forks source link

Problem provisioning (wget issue) #14

Closed sehz closed 2 years ago

sehz commented 4 years ago

I am getting following error which something to do with wget.

ks.aws_launch_configuration.workers[1]: Still creating... [10s elapsed]
module.eks.aws_launch_configuration.workers[0]: Creation complete after 10s [id=training-eks-W5YjPdfh-worker-group-120200724013458477900000010]
module.eks.aws_launch_configuration.workers[1]: Creation complete after 10s [id=training-eks-W5YjPdfh-worker-group-220200724013458484400000011]
module.eks.random_pet.workers[0]: Creating...
module.eks.random_pet.workers[1]: Creating...
module.eks.random_pet.workers[0]: Creation complete after 0s [id=capable-snipe]
module.eks.random_pet.workers[1]: Creation complete after 0s [id=deep-wombat]
module.eks.aws_autoscaling_group.workers[0]: Creating...
module.eks.aws_autoscaling_group.workers[1]: Creating...
module.eks.null_resource.wait_for_cluster[0] (local-exec): /bin/sh: wget: command not found
module.eks.null_resource.wait_for_cluster[0]: Still creating... [20s elapsed]
module.eks.null_resource.wait_for_cluster[0] (local-exec): /bin/sh: wget: command not found
module.eks.aws_autoscaling_group.workers[0]: Still creating... [10s elapsed]
module.eks.aws_autoscaling_group.workers[1]: Still creating... [10s elapsed]
MEOWMEOW114 commented 4 years ago

I faced the same issue, and found this is the workaround

im2nguyen commented 4 years ago

Thanks @MEOWMEOW114

To address this issue, add the following to your module "eks" {} in eks-cluster.tf.

module "eks" {
   ...
+  wait_for_cluster_cmd  = "until curl -k -s $ENDPOINT/healthz >/dev/null; do sleep 4; done"
}
tanakamapondera commented 4 years ago

@im2nguyen I don't know what I'm doing wrong but that solution does not work for me sadly. This is the errow message I am getting: Error: Error running command 'until curl -k -s $ENDPOINT/healthz >/dev/null; do sleep 4; done': exec: "/bin/sh": file does not exist. Output:

im2nguyen commented 4 years ago

@tanakamapondera , what OS and Terraform version are you using? It seems like your system doesn't have bash.

This https://github.com/terraform-aws-modules/terraform-aws-eks/issues/925#issuecomment-648057547 comment includes a workaround for Window machines. Please let me know if that works!

HormCodes commented 4 years ago

On OSX: Installing wget using Homebrew can also fix the issue: brew install wget.

alanszlosek commented 2 years ago

This should now be fixed by #65. Please let us know if you are still having issues.