Are there good use-case documentations for pulumi?...
# getting-started
i
Are there good use-case documentations for pulumi? In my lab, because I'm using multiple machines with pulumi, i'm having to re-import frequently because other machines are being used to modify my k8s cluster. Is that normal?
l
No. If you share state (and you should), then this is not normal.
If you have separate state files on each machine, then it is expected, but wrong.
i
So how do I share state between two separate machines?
l
You could use the Pulumi app, or a cloud backend like S3.
i
sorry, how do I get the state files out?
they're not stored in my source dir along w/ my other python if i'm not mistaken
l
Depends on where you store them. What are your parameters to
pulumi login
, and what is the content of the
backend
property in your project YAML file?
i
No backend specified
Copy code
/usr/bin/pulumi login --local
This is all managing my local k8s cluster , that's running k3s.
l
If you haven't configured the backend in your project file, it'll be in your home directory. Not sure what it'll be called though. Maybe ~/.pulumi/workspaces/project-name-hash/state.json, or similar? Someone else might know, I don't use local backend, sorry.
i
no bigs. but it sounds like the most frequent usecase isn't local
l
Yes, local is ok for practice and investigation, but it's not a good idea for anything production-like. You'd have to manage your own version control, locking, backups, etc.
And of course, you can't deploy from anywhere else without importing over and over again...
i
yep.
luckily importing is quick for what i'm playing with, but also good to know it only works w/ gcp/aws/az
l
What does? Shared backends? There are other places to store them. The Pulumi cloud service being the most notable. But also, a shared drive that's properly backed up can work, if you're careful.
i
trying to keep it all in house per se.
but yeah, if i have money to pay for a production level k8s cluster in the real world, I can pay for pulumi cloud
l
Pulumi service is very cheap when you have a small number of resources. And of course, you can use S3 or similar.
i
yep.
l
@important-energy-56546 have a look at MinIO which offers an S3 compatible API that works with Pulumi. You can deploy that within your own network to share your state files.