Skip to content

Conversation

@fgrutsch
Copy link

What this PR does / why we need it:

We are currently running a setup where we have a k8s cluster running on Hetnzer cloud with a public IP and a private network. We also have bare metal nodes (setup manually and not running k8s) which we are connecting via a private network (vSwitch) to the k8s nodes. The setup works in general, but the controller reports errors due to multiple subnets restriction.

The idea of the PR is that we could allow multiple subnets in a network as long as the first subnet matches with the one that is configured on the HetznerCluster resource. When attaching a server to the network it will use the first subnet by default.

Wdyt about that solution? I have seen in multiple issues that you don't use private networks in your product and I think therefore this would be an acceptable solution to connect bare metal nodes <-> cloud nodes without making major modifications to the project's code.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

Special notes for your reviewer:

TODOs:

  • squash commits
  • include documentation
  • add unit tests

@fcuello-fudo
Copy link

I just tried this PR and it's working fine for us. Thanks.

@suyash-811
Copy link

Hi @fgrutsch,
Thanks for the PR. i tried this on my end and could only party make it work, and hence wanted to ask you some details about it.

Some context about how i used the PR:
I created two cloud subnets, and one vswitch subnets. The controller did identify correctly that the first subnet was indeed the configured subnet. However, the servers that were created were attached to the second cloud subnet (which is not the intended behavior I'm going for)

When i however only have one cloud subnet, and one vswitch subnet it works out perfectly. How is your use-case? Do you also have only one cloud and one vswitch subnet?

Thanks in advance 😄

@fgrutsch
Copy link
Author

Hi @suyash-811,

our use case is that we only have 1 cloud subnet and 1 vswitch subnet, therefore it is working. The problem with Hetzner's API back then was that you couldn't specify the subnet of the network where the server should be attach to. I checked the API again and it seems like that this is possible now (see changelog).

With this API change I think the PR could be updated and improved by providing the ip_range of the configured subnet and then it should work. Also the validation if the first subnet matches the configured one can be changed by just checking the configured subnet is contained in the network only.

Unfortunately, I have no time right now to give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants