kyma-incubator/terraform-provider-kind

Option to wait for cluster to become ready

Closed this issue · 3 comments

Description

When you create a new cluster, the default behaviour is that it doesn't wait for the control plane node to become ready. i.e if you do a kubectl get no you'll see a NotReady status.

The kind package supports an option to wait but it is disabled by default. It would be nice to expose this as an optional attribute so we can tell Terraform to wait for the cluster to become fully ready.

Example

resource "kind" "example" {
  name = "example"
  wait_for_ready = true
}

Terraform has a timeouts feature baked in, so we could supply the value for the Create timeout when creating the kind cluster.

References

CreateWithWaitForReady option: https://github.com/kubernetes-sigs/kind/blob/master/pkg/cluster/createoption.go#L85

Hey John,

This seems like a useful change, I'm not sure I can tackle this at this point as I'm working on something else currently, but will get to it as soon as I can. In the meantime, we'd be happy to have your contribution on this as well if you feel the immediate need for it.
I've just updated the dependency to kind v0.8.1 so you should be able to use the latest version for this, that you linked.

Hey @jrhouston,

Took a quick stab at this: #15, it seems to wait at least for control plane to be ready, but not the worker nodes. Is that what you had in mind?

Cheers,
Daniel

In my current workflow I have a script that waits until the control-plane node is ready, but I think this was just the easiest way to tell if the cluster was ready yet, otherwise I would get errors from kubectl if I tried to apply something immediately after running kind create. So I think what you've done in that PR should suffice - if not we can add some additional logic to wait for nodes to become ready too.