-
-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hetzner Bare Metal server support #433
Comments
@maaft We use the official CCM https://github.com/hetznercloud/hcloud-cloud-controller-manager, the other is a fork of this one (maybe modified). May that previous discussion is related, please have a look #283. Also, if you find a way, PRs are most welcome, as long as you test it well on your end. @phaer You may have more ideas on this! 🙏 |
@maaft I think that should work already, if attached via a |
@ifeulner the official CCM does not support bare metal servers (i.e. robot api). Which makes provisioning LBs with bare metal server IPs impossible currently. (Meaning that routing traffic from LB to any service that runs on bare metal, e.g. database, is also not possible) |
@maaft In that case please do not hesitate to submit a PR that adds the ability to change the CCM by choice (via a variable for instance), as long that everything keeps on working. |
@mysticaltech will do! Could you just kindly point me to the location where the current CCM is being configured/setup? |
Small update: I managed to connect my bare metal servers and use my own CCM. Unfortunately, I now get this error during node syncing:
Question: Who exactly is producing that error message? Is it kubernetes itself? Is it my CCM? |
@maaft It's the CCM that ultimately is the reason for that error, for sure. But well done, you are getting close. You could maybe research this error on GitHub, and the CCMs repos of course. |
Here is my worker config for k3s: "flannel-iface": "enp9s0.4000"
"kubelet-arg":
- "cloud-provider=external"
- "volume-plugin-dir=/var/lib/kubelet/volumeplugins"
"node-ip": "10.1.0.2"
"node-label":
- "k3s_upgrade=true"
"node-name": "bm-worker3"
"node-taint": []
"server": "https://<master ip>:6443"
"token": "<token from master>" The issue is probably this:
My conclusion is, that there needs to be a way to preconfigure the CCM with all bare metal IPs (internal and external). Not sure if this can be done with k3s. I tried Side-Note: Now I'm trying to setup something similar with --node-external-ip <SERVER_EXTERNAL_IP> --flannel-backend wireguard-native --flannel-external-ip as flannel should already be able to handle wireguard meshing. |
Got it working. Setup:
Changes which are needed to this repo to support Bare-Metal servers:
Not sure if I have the resources to do everything by myself. It would be very helpful if anyone could add an option to disable the private network (and adapt firewall + LB configurations accordingly). As I'm fairly new to |
I created this PR to support custom CCMs. Note that the CCM by syself is currently not working, because apparently it cannot handle private networks. |
@maaft Thank you for your research and efforts, this may be valuable for us one day, but currently using the private network is very important to minimize latency between the nodes and remove the need for wireguard encryption. Please note that this project locks k3s to the private network via this attribute in the k3s config Now if you can make it work with both private networks and public networks together (basically just remove the |
Just for clarity @maaft, I indeed think that we would need to use So hetzner cloud nodes need to keep their private IPs in the k3s config, and if the bare-metal server cannot have a private IP as you explained above, then it needs to use its public one. In which case, need to create another |
Thanks, I'll look into the dual-interface approach. Would make things definitely easier if I don't need to implement some Do you happen to know if flannel can be configured to use its wireguard backend only for public-facing traffic? I'll dig into this Edit: Is this what we want here? |
@maaft Going through public network on the over hand is an order of magnitude faster, which might result in wireguard being a viable option? |
@Lennix it's not off-topic at all! I also read about that and it makes sense. But I wasn't able to connect my bare metal server through the vSwitch, due to some issues with the CCM I use (I believe). Anyway, when I understood @mysticaltech correctly, his suggestion was to use both VPN (on cloud nodes) and wireguard (on bare metal) as k3s supports this. Btw, it seems to run fine with the hybrid approach. Only issue currently is that my CCM is not able to create a route (?): I1205 14:13:04.581520 1 event.go:294] "Event occurred" object="bm-worker3" fieldPath="" kind="Node" apiVersion="" type="Warning" reason="FailedToCreateRoute" message="Could not create route 8c6a8bdb-4931-4189-****-******* 10.42.2.0/24 for node bm-worker3 after 201.328998ms: hcloud/CreateRoute: hcops/AllServersCache.ByName: bm-worker3 hcops/AllServersCache.getCache: not found" |
@maaft The hybrid approach described in the k3s docs seems indeed to be what we need in that case. Basically, it will create a wireguard VPN on top of all interfaces if I understand it correctly. This would be ideal! |
Also @maaft, did you try with this ccm, the author seems to have solved the issue (found it here): https://github.com/identw/hetzner-cloud-controller-manager |
Ah no, it's won't work the above, the syself seems to be the ccm for the job. But interesting to read the docs of the one from @identw, as it says that you need to give names to servers in the robot console (not sure if its important), but there is definitely a way to make this work, you are close @maaft ! 🍀 |
@mysticaltech Setting the name is indeed important, because in this way the syself CCM is able to retrieve the correct IP (by matching the names). At least this is how I think it works. Anyway, currently I'm stuck on two, maybe unrelated, points:
I1205 14:13:04.581520 1 event.go:294] "Event occurred" object="bm-worker3" fieldPath="" kind="Node" apiVersion="" type="Warning" reason="FailedToCreateRoute" message="Could not create route 8c6a8bdb-4931-4189-****-******* 10.42.2.0/24 for node bm-worker3 after 201.328998ms: hcloud/CreateRoute: hcops/AllServersCache.ByName: bm-worker3 hcops/AllServersCache.getCache: not found" If I can't get this to work by end of this week, I have to fallback to my What is the real speed benefit of wireguard vs. hetzner VPN anyway? Did anyone measure some latencies? |
@maaft My understanding is that when you use the hybrid approach you have to: Set both While not forgetting to use the |
@maaft I understand you finally cracked the code for this. Please do share whenever you can 🙏 |
@mysticaltech I did not bother to run both hetzner VPN and flannel wireguard at the same time. Anyway, here's what I did:
If you have any suggestions on how to integrate all of this into the codebase, I'm happy to help. But I need guidance here. Also, dual stack should of course be tested before adding an |
Thanks for sharing @maaft, it's good to have the info here for others. For now, I will close this issue, as it's too custom to officially support just yet. |
Is there any further progress to include bare metal support directly as part of kube-hetzner? |
@schlichtanders There is a significant change on hetzner's side. They have included access to bare metal servers via the network and hcloud ccm. That's a game changer! hetznercloud/hcloud-cloud-controller-manager#523 We are not actively working on this at the moment, but PRs welcome. |
Discussion opened here: #1311 |
Did anyone successfully integrated hetzner bare metal servers into their
kube-hetzner
cluster?Bare-Metal servers are cheap and ideal for long running, resource-hungry tasks like databases.
Following steps are needed to make this work:
(
x
means that the step is absolutely possible currently)kube-hetzners
CCM to retrieve IPs from bare-metal servers for LB configurationThe last point is currently missing. But I already successfully integrated Hetzner Bare Metal servers by using a different Hetzner CCM than that from the official repo and using TalosOS.
Questions:
kube-hetzner
using?The text was updated successfully, but these errors were encountered: