When I have a stack, and it creates a new cluster then sticks things in the cluster - I've got that ...
f
When I have a stack, and it creates a new cluster then sticks things in the cluster - I've got that working fine, but there is a temporary issue where it seems like cloud provider is returning that the cluster is ready/done, but it is not actually ready. If I just wait a few minutes and try again, then k8s resources can be used fine. The error I get is "error: configured Kubernetes cluster is unreachable: unable to load schema information from the API server ... connect: connection refused". In this case the cloud provider is Vultr. Is there something I can do be more tolerant, especially after initial creation? Of course it would be nice if Vultr plugin didn't return until it was also ready. Note that I have set
KubeClientSettings
to a high value, and that did not seem to help. Basically I'm trying to get to the point where my whole stack can be brought up with a single run.
d
On one hand, breaking things into separate stack(s) is a good practice, and making the cluster separately from its workload(s) is worth considering. On the specific problem, perhaps the new hooks feature would help you to wait until the cluster is truly up. https://www.pulumi.com/blog/resource-hooks/
f
Do have a page that describes that process on deciding what is within a stack vs. a separate stack? The boundaries are a bit fuzzy to me. The Resource Hooks do indeed look useful for this specific case, thanks!
d
I think it is a topic touched on in Pulumi blog posts. My personal take is to: 1. focus on encapsulation of configuration data, e.g. into components representing individual apps or workloads. 2. think about the personas and security roles needed to deploy a stack 3. deploy each layer of infra as it own stack, if the layer is independently serviceable or has a different cadence than the things it hosts. For example, it makes sense to deploy a VPC layer as an independent stack. Use stack references to pass configuration info upwards from layer to layer.
f
Thanks!