Solution for multiple networks for nodes #1388
roberto-sebastiano
started this conversation in
Ideas
Replies: 1 comment
-
@roberto-sebastiano This is amazing, thanks for sharing! Wow. @kube-hetzner/core @maaft FYI |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Hello,
In my setup on Hetzner, I use two private networks, one for kubernetes cluster and one for other service VMS.
For security reasons, I needed the Kubernetes nodes to access the service VMs via a private network, not via the public one.
In this setup, it's necessary for all the VMs, including the Kubernetes nodes and service VMs, to be members of both networks for the private network access to work.
I couldn't find a way to do it in the project. I only see existing_network_id that is unfortunately a list of length 1
I think this should allow multiple networks.
After looking at the hcloud documentation, it seems this is hardcoded (I can't find the line right now, sorry).
SOLUTION:
I've made a custom solution that works quite well for me and may benefit others too,
hetzner-aux-node-operator
As a simple operator, it loops over nodes (all the kubernetes one + other VMs you can specify) and adds them to the required extra networks.
As a plus, it also enforces a firewall (or any number of them) to be always applied to all nodes.
If you manually remove a node from a network or firewall by mistake, the operator kicks in and enforces the attachments again.
This is a sample output of the operator in action after adding some nodes:
You can find it here https://github.com/roberto-sebastiano/hetzner-aux-node-operator
If you think this could be accomplished in a different way or do you want to write this somewhere, you are welcome
Thank you,
Roberto Sebastiano
Kube.tf file
Screenshots
No response
Platform
Mac
Beta Was this translation helpful? Give feedback.
All reactions