Closed lhp-nemlig closed 2 months ago
Just to make sure we are on the same page:
Instead of assigning a random/next IP to the Load Balancer in the private Network, you want to explicitly set the IP that the Load Balancer should have (through an annotation).
Did I understand you correctly?
Yes that is correct, and this PR accomplishes that.
If explicitly setting an IP was not possible, reserving a set of IP's for VM's would be impossible as the load balancers could randomly make use of them.
E2E tests are successful.
Attention: Patch coverage is 85.71429%
with 4 lines
in your changes missing coverage. Please review.
Project coverage is 71.81%. Comparing base (
8d29153
) to head (17a1f0c
). Report is 7 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
hcloud/load_balancers.go | 66.66% | 1 Missing and 1 partial :warning: |
internal/hcops/load_balancer.go | 90.90% | 1 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Allows users to specify the IPv4 of the load balancer in the private network via the annotation "load-balancer.hetzner.cloud/private-ipv4"
Removes network logic from main load balancer creation, since the API does not support specifying the IP address there, and moves network logic to exclusively happen in AttachToNetwork and DetachFromNetwork.
I also added an extra LoadBalancer refresh in the main reconciliation loop, since changing the IP address of an SVC object causes network detach and subsequent attach, which in turn needs to cause the targets to be re-added to loadbalancer if they were private network targets.
Unit tests pass and i have tested this in a few scenarios on a cluster of my own.