kube-hetzner / terraform-hcloud-kube-hetzner

Optimized and Maintenance-free Kubernetes on Hetzner Cloud in one command!
MIT License
2.33k stars 356 forks source link

Feature request: Way to add hetzner dedicated server instance as agent node #215

Closed yashodhank closed 2 years ago

yashodhank commented 2 years ago

It would be awesome if you consider ability to automatically deploy vswitch with dedicated server to hetzner cloud instances (join the cluster).

I am still learning and I really love the way you all have built this amazing project. I have experimented with it and so far and it worked effortlessly. Thank you so much for that.. I am looking forward to contribute too.

phaer commented 2 years ago

As far as I am aware, there's no terraform provider for neither vswitches nor dedicated servers we could use for that feature. At least https://registry.terraform.io/providers/hetznercloud/hcloud/ does not support them. And even if there was, I don't think you can use vswitches with hcloud hosts? As long as that's the case I am afraid this feature request is out of scope.

yashodhank commented 2 years ago

I agree, there is no official support yet as it is with hcloud.

but there are few working implementations https://registry.terraform.io/providers/Peters-IT/hetzner-robot/latest https://github.com/Peters-IT/terraform-provider-hetzner-robot

phaer commented 2 years ago

Did you test it? From the docs it looks like it neither supports provisioning servers nor attaching hcloud_networks to vswitches (just reading them). If it works, I think a first step would be to implement a shared network on top of kube-hetzner, the only change to kube-hetzner required would be to expose the network_ids, to attach them to the vswitch, right?

Joining dedicated machines into your cluster would probably left as an exercise to the reader as it depends on your provision those servers. That would be an interesting project in itself, but probably best implemented on top of kube-hetzner (re-using its terraform modules for the hcloud part).

Let us know if you start hacking on this :)

yashodhank commented 2 years ago

Sure, valuable feedback. :) I have seen couple of tutorials explaining how to connect vswitch vlan and hcloud for private network connection between root servers and hcloud instances.

I am going to test it in next couple of days.

Ref Docs: https://robot.your-server.de/doc/webservice/en.html#preface

Interesting project yesterday came across (it implements HCLOUD + ROOTServer API): https://github.com/syself/cluster-api-provider-hetzner/blob/main/docs/topics/preparation.md

phaer commented 2 years ago

Very interesting, thanks! I am renting a bunch of bigger dedicated machines and two vswitches from Hetzner myself (albeit not running kubernetes there) and learning that you can, at least nowadays, join them into private networks with hcloud machines is quite interesting to me.

https://github.com/syself/cluster-api-provider-hetzner/blob/main/docs/topics/preparation.md

That one looks very interesting indeed, hadn't heard of it so thanks a lot!

mysticaltech commented 2 years ago

Moving it to a discussion where it makes more sense, in the ideas section.