What do you do when you want to learn something ne...
# general
g
What do you do when you want to learn something new, have to stay indoors all day, and have a few K8s manifests lying around?… exactly you build a Pulumi project to deploy an app with • 5 secrets • 2 configmaps • 12 deployments • 12 services • 2 nodeports Built it with TypeScript, because I’d never done that before and I’m kinda pleased with the result 😅 https://github.com/retgits/acmefitness-pulumi
👌 1
🎉 4
r
Did you already learn about kubernetesx? https://github.com/pulumi/pulumi-kubernetesx That might reduce the amount of boilerplate code you need to write for kubernetes manifests…
I also like to use `ComponentResource`s to structure my deployments on an application level (meaning frontend, backend and required databases) for each microservice.
The main use case for them might be building reusable components that you can leverage in other deployments, but I also find it pretty nice to have my resources structured hierarchically in a single pulumi project (without any plans for reusing the components). That also allows to expose a clean pulumi API for each service (e.g.
OrderComponentOptions
with some
hostname
and `imageVersion`and
replicaCount
settings).
And you get some nice file structure for free when you put the components into their own
.ts
files and just import and instantiate in the
index.ts
g
Before this I only used the Go SDK for Pulumi which doesn’t have component resources yet, so I didn’t know about that. I’ll go check it out! Thanks for the feedback 🙌
r
Yep, that’s a bit the downside of multi-language-support. I started with typescript/nodejs as it looked like the language/runtime that is used most widely. And things like kubernetesx were built only for this.
Definitely have a look at
kubernetesx
and `ComponentResource`s. Happy to hear about your experiences…