microservices-demo icon indicating copy to clipboard operation
microservices-demo copied to clipboard

Terraform's `kubectl wait --for=condition=ready pods ...` hangs

Open NimJay opened this issue 3 years ago • 3 comments

Describe the bug

To Reproduce

  • I have not reproduced the issue myself yet.
  • But we can try to reproduce this issue by running the terraform apply (as seen in /terraform/README.md) multiple times.

Logs

  • N/A

Screenshots

  • N/A

Environment

  • TBD

Additional context

  • tpryan@ might be able to provide additional context.

Exposure

  • This would affect anyone using Terraform to deploy Online Boutique.

NimJay avatar Sep 21 '22 15:09 NimJay

@tpryan Is my assumption correct: you witnessed this issue when Cloud Build tried running this line?

NimJay avatar Sep 21 '22 15:09 NimJay

Yes. But it also occurred during manual tests - ie calling terraform directly, and not in the test script.

tpryan avatar Sep 21 '22 16:09 tpryan

It's intermittent. And I can't tell what variables are changing. I have a build job that runs it every night. So in theory I will get logs for you to sift through eventually. :)

tpryan avatar Sep 21 '22 16:09 tpryan

The configuration enforces kubectl wait to wait forever. In this condition, if the cluster does not have sufficient resources, the command indeed will run forever. I suggest to change and check the returned status. Note that the --timeout parameter defines waiting time for each pod. So, in theory it can wait for timeout * number_of_pods time.

minherz avatar Oct 06 '22 18:10 minherz

@NimJay i suggest to close this item. there is no clear reproduction path. as an option, we can add a timeout argument to the relevant Terraform configurations to avoid tests to hang out forever.

minherz avatar Dec 14 '22 21:12 minherz

Issue Disappeared

NimJay avatar Mar 14 '23 13:03 NimJay