by moondev · 6y ago · 0 comments
Kubernetes manifests are declarative by design and for good reason, the controllers reconcile the state not your script.
Interested to hear Pulumi examples where this is desired and where it fits in with other tools.
The Pulumi engine uses a desired state model[1]. You can use imperative language features like loops and conditionals, but all of that gets mapped to a declarative resource graph prior to diffs/updates.
[1] https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/
People spend loads of engineering effort (years, really) to get that controller to function properly under every weird state case, while the neckbeard with a shell script, hot failover master-master write nodes and an ELB gets five nines without needing a CS degree.
What concerns me somewhat about Pulumi is we will lose some of "standardization" that comes with the widespread use of Terraform.
Like anything else, it is possible to write Terraform in an incomprehensible way. However, overall I have found that Terraform "constricts" things into being done a certain way. This allows engineers to jump into a new TF codebase and grok what is happening fairly easily.
Now with Pulumi, we lose that constraint, and now have to grok not only the different languages that infra is defined in, but also the wide variety of different "styles" that a language can be written in. An engineer joining from another company or team now has to deal with a new language and a new code style/organization in order to wrap their head around the infra. Not a desirable property when it comes to managing the infrastructure for a company.
While it is appealing that a developer can use a language they are already familiar with to manage infra, that only holds true if the language being used for Pulumi is one they are already familiar with.
I could of course be totally wrong. Regardless, I am excited to see a new contender in the space.
And Terraform doesn't even support declarative configuration management!!! The syntax is declarative, but it literally can not change the infrastructure to be the way you describe, if it has changed outside your state file (which can happen at literally any time).