https://pulumi.com logo
#general
Title
# general
g

gorgeous-elephant-23271

03/01/2020, 12:48 PM
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

better-rainbow-14549

03/02/2020, 8:49 AM
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

gorgeous-elephant-23271

03/02/2020, 9:10 AM
Sounds about right - do you just have multiple folders each with a project then?
b

better-rainbow-14549

03/02/2020, 9:10 AM
completely independent stacks
g

gorgeous-elephant-23271

03/02/2020, 9:11 AM
Thanks, might try that!
b

better-rainbow-14549

03/02/2020, 9:11 AM
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

gorgeous-egg-16927

03/02/2020, 3:18 PM
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

salmon-account-74572

03/02/2020, 4:07 PM
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

gorgeous-elephant-23271

03/02/2020, 7:04 PM
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?
2 Views