# general


02/01/2024, 1:00 PM
Hi guys! Nice to meet you, my name is Diogo! I'm using Pulumi to setup both the infrastructure and the application itself for a certain service that I need to spin up, and this includes setting up a cluster for it as well. This is on GKE, and the application is (obviously) a bunch of manifests built with Pulumi. All running as GitHub Actions. However, I have a chicken-and-egg problem: The infra code creates the cluster, but for the app code to apply it needs the kubeconfig to be available, but I can only setup the kubeconfig if the cluster is already up (using
), and this can't be done because at this point the cluster is not yet up. Is there a way to make all of this work in a single shot? Or do I have to strictly separate the cluster setup from the app setup?


02/01/2024, 1:11 PM
You can generate the kubeconfig to be used with the kubernetes provider:
I'd recommend keeping app deployment in a separate stack to cluster creation/management though


02/01/2024, 1:12 PM
Ah, cool, thanks! 🙂
@dry-keyboard-94795 is there any documentation about good practices for separating IaC from app/manifest code? Like, how to properly structure configs + directory structure etc


02/01/2024, 5:39 PM
I, too, would recommend separating the cluster and the application into separate stacks---they (quite likely) have different lifecycles.


02/01/2024, 6:03 PM
Mostly, yes, but since I'm doing this for a self-managed service that's built by a third party, I'm putting it all together. In general, though, that's a good point, I agree 🙂