-
Notifications
You must be signed in to change notification settings - Fork 67
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
✨ Bring your own network #1472
base: main
Are you sure you want to change the base?
✨ Bring your own network #1472
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this approach seems good to me. Thanks a lot for this contribution!
@guettli @batistein what's your opinion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot again for this PR @johannesfrey. I think we can merge it if you follow the suggestions I gave. It's really good work!
3f6b8f6
to
b27b859
Compare
Sorry for the long delay 🙏 . Thx for the reviews! I hope I addressed your suggestions correctly. PTAL. Thx! |
b27b859
to
028f798
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @johannesfrey ! I went another time over the details and found a few things.
bdf6ca4
to
4806de2
Compare
thanks @johannesfrey! Do you think anything is missing right now? If not, I'd propose the following path:
|
That sounds awesome. Thx! The reconciler should then use its internal client (which should be the shared fake one from before) to find the network. But it cannot find it, so there must be something in the line that deleted it or there is some race when using the fake client and probably the usage of the mutexes in there?! I tried some variations of changing the locks in there, but to no avail. So wasn't able to really deflake the test. So, would be really cool if you could take another look there. And if the test makes more harm than that it's helping, we could also think of removing/chaning it. WDYT? |
mmh that's an important observation, thanks @johannesfrey. We will have a look. I'm not able to see anything in the code right now. |
What this PR does / why we need it:
This PR makes it possible to "adopt" a pre-existing network by passing its ID to
hetznerCluster.spec.hcloudNetwork.id
instead of the network being created during cluster creation. Furthermore, during cluster deletion it only deletes the attached network if it does not have theowned
label attached to it (currently the only way here to discriminate between a CAPH-managed network and an unmanaged one).Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #762
Special notes for your reviewer:
This has been lingering around for a while untouched on my fork and I decided to rebase it onto the current main branch. Please consider this as a first attempt to approach this topic as a whole. I also tried to already add some unit tests. I guess it also might require some e2e tests!? No idea if this is the desired way to do this and about other side-effects I did not see. So looking forward for feedback or any pointers. And also feel free to push changes to the PR, as I'll be pretty occupied with other things almost the whole September. Just wanted to push this out there already for you to take a look at 🙂
The most controversial changes so far:
hcloudNetwork.id
mutually exclusive withcidrBlock
,subnetCidrBlock
andnetworkZone
cidrBlock
,subnetCidrBlock
andnetworkZone
to be pointers (I guess this could also be done with empty strings, but pointers make it possible to be not shown at all, when not provided)Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.
TODOs: