Hey guys! does anyone know a good project to have ...
# kubernetes
c
Hey guys! does anyone know a good project to have k3s cluster in hetzner using Pulumi?
s
Are you looking for a Pulumi example that runs k3s, or something in the field where people would use k3s in Hetzner?
c
yes exactly, since Pulumi has hcloud provider it make sense
s
Which are you looking for: an example, or a use case?
c
example
I'm thinking of creating one, like cluster of 3 servers and networking everything done with Pulumi
s
There's nothing in https://github.com/pulumi/examples, which is the first place I check. So, I would recommend trying out Pulumi AI for this: https://www.pulumi.com/ai/conversations/0d248c8e-426d-43e8-bef5-f12cc0cfa384 If you want to create something more polished yourself and blog it, we may be able to promote. I'm not sure whether we would be able to accept a contribution to pulumi/examples because the maintenance overhead is getting pretty high due to the large numbers of examples.
Does that answer your question? Let me know if you need any more help.
c
yes, thank you!
q
I have a working example of multi-node k3s on hetzner in Scala via hcloud provider and command package if you're interested.
c
Thant would amazing! thank you very much
q
https://github.com/lbialy/scali.fyi here's a companion repo for a talk I gave on Lambda Days last year showcasing automation api in pulumi-scala, the stuff you're interested in is here: https://github.com/lbialy/scali.fyi/blob/main/platform/Main.scala and here: https://github.com/lbialy/scali.fyi/blob/main/platform/k3s.scala
hetzner vms are deployed to a pool of servers (the pool in the demo has only one server because I didn't want to deal with issues related to PV locality and didn't want to deploy longhorn or minio to keep complexity low but it does work with bigger server pools) modulo'ed against locations of hetzner DCs
K3S deployment is a component resource that encapsulates the chain of commands (via pulumi-command) that have to be executed to set up the cluster, ordering is correct, leader is spawned first and once you obtain the join token from the leader other nodes are deployed in parallel
use some kind of LLM to translate it to whatever language you're using with pulumi, fyi:
.parSequence
is the equivalent of
Output.all
in TS
s
@quaint-spring-93350 How was your experience using Pulumi with a non-Java JVM language, out of curiosity?
Oh, and now I understand why Besom (which I've heard of) is named what it is...
q
I am the lead designer of pulumi-scala, so my opinion is probably a little biased... but it's great!
s
@quaint-spring-93350 That's a very impressive technical accomplishment! It ain't easy to add language support! Are packages in one JVM language usable in all other JVM languages?
q
nope, pulumi-java packages are not usable with besom as it was built from ground up, but we publish all packages in the catalog, around 180 of them
f
try https://github.com/QC-Labs/orange-lab meant for home labd but can be refactored to cloud