kube-hetzner / terraform-hcloud-kube-hetzner

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

Add floating IPs for wireguard hybrid cloud / multicluster #1468

Closed s04 closed 2 months ago

s04 commented 2 months ago

Description

I'd like to have 1 node in every Hetzner region and my master node in eu-central.

They should all be connected in the same cluster even if they don't share a network/subnet.

Currently we allow for "enable_wireguard" for encrypted connection between nodes (on the same network) but according to the K3s docs, for the hybrid/multicloud approach I also need to specify the external IP of each node upon initialisation.

Solution Suggestion:

I'd like to pre-create some floating IPs and then pass these to the agents so they all get these IPs.

Then I can also use the Kubelet option defined in the docs:

--node-external-ip=<SERVER_EXTERNAL_IP> --flannel-backend=wireguard-native --flannel-external-ip

I need to know the IP upon creation of the nodes.

K3s Documentation to the Distributed Multicloud feature

I'm comfortable with Terraform but I just need a pointer in the right direction with what files I'll need to edit to enable this feature. Then I'll open a PR.

Thanks in advance and thanks for this amazing project!

Saul