Hi there, if I'm deploying a k8s cluster with pulu...
# general
g
Hi there, if I'm deploying a k8s cluster with pulumi and also what goes in to that cluster, should I use a single stack, or multiple? It would seem to make sense to have one, but would it be coupling infra to apps by doing that?
b
we split them apart for the assurance that an app stack wouldnt tear down the cluster if there was some bug, to speed up refreshes and updates and yeah to decouple the multiple app stacks from its infrastructure
we ended up having a ton of additional things like nginx, cert-manager, aad-pod-identity, kured etc
and it was getting really unwieldy
g
Sounds about right - do you just have multiple folders each with a project then?
b
completely independent stacks
g
Thanks, might try that!
b
we just put cluster.kubeConfigRaw in a keyvault from the cluster stack and then load it in to create a kubernetes provider in each app stack
but there are StackReferences now which is probably more sensible
g
I generally keep them all in the same stack for local dev / prototyping, but would also suggest splitting them up for production use cases.
s
I'd use separate stacks for the very reason you suggest in the next post---possibly being able to deploy the app(s) locally or to a production-quality cluster in the cloud.
g
Thanks for the input all. Perhaps a follow on topic, how do you manage k8s contexts? Do you copy the kubeConfigRaw from your infra stack to your app stack so you can use it?