Skip to content
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

ANXKUBE-1251: Allow setting hostname via annotation instead of IPs #355

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

89Q12
Copy link
Contributor

@89Q12 89Q12 commented Nov 20, 2024

We want to allow setting a hostname on the LB instead of IPs, this is useful when using proxy-protocol in LBaaS.

Checklist

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request

@89Q12 89Q12 self-assigned this Nov 20, 2024
Copy link

codeclimate bot commented Nov 20, 2024

Code Climate has analyzed commit c2aab4c and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 0.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 56.8% (-0.6% change).

View more on Code Climate.

@nachtjasmin nachtjasmin force-pushed the ANXKUBE-1251/hostname-from-annotation branch 2 times, most recently from 579b446 to 8d6d143 Compare January 13, 2025 11:05
Copy link
Contributor

@nachtjasmin nachtjasmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusted the code a bit, added documentation and aligned the name of the annotation with the other one.

@nachtjasmin nachtjasmin force-pushed the ANXKUBE-1251/hostname-from-annotation branch from 8d6d143 to d8130db Compare January 13, 2025 11:17
@89Q12 89Q12 removed their assignment Jan 13, 2025
@nachtjasmin nachtjasmin force-pushed the ANXKUBE-1251/hostname-from-annotation branch from d8130db to c379f2d Compare January 13, 2025 13:36
@nachtjasmin
Copy link
Contributor

Manually tested the changes with a SingleStack and a DualStack service. In both cases, the resulting .status contained the expected changes and was reconciled as expected.

From my point of view, this PR is ready for another review.

@LittleFox94
Copy link
Collaborator

Verified works :)

@nachtjasmin nachtjasmin self-assigned this Jan 14, 2025
By setting the hostname via an annotation on the given Service, we can
workaround the shenanigans of kube-proxy to enable support for the PROXY
protocol. In addition to the annotation being set, there's a
configuration change needed by the LBaaS operators which is done
manually right now.

This change is also done by other CCM implementations, like the one of
[DigitalOcean].

[DigitalOcean]: https://github.com/digitalocean/digitalocean-cloud-controller-manager/blob/d274be6e44f650311e4b960960b23001e6e513b4/cloud-controller-manager/do/loadbalancers.go#L236

Right now, this implementation is lacking proper tests to test this
behaviour, which were skipped due to missing test infrastructure and a
lack of time.

Closes: ANXKUBE-1251
Co-authored-by: Zofia Hagenguth <[email protected]>
@LittleFox94 LittleFox94 force-pushed the ANXKUBE-1251/hostname-from-annotation branch from c379f2d to c2aab4c Compare January 14, 2025 10:29
@LittleFox94 LittleFox94 enabled auto-merge (rebase) January 14, 2025 10:34
@LittleFox94 LittleFox94 disabled auto-merge January 14, 2025 10:34
@LittleFox94 LittleFox94 merged commit 6cae201 into main Jan 14, 2025
7 of 9 checks passed
@LittleFox94 LittleFox94 deleted the ANXKUBE-1251/hostname-from-annotation branch January 14, 2025 10:34
nachtjasmin added a commit that referenced this pull request Jan 15, 2025
Because the IP of the LoadBalancer Service is no longer exposed, it would
get harder to setup DNS records. The current workaround would be:

 * Wait for the LoadBalancer to be reconciled without the annotation.
 * Write down the IP address to configure it elsewhere.
 * Annotate the service.

This only works because there's a limitation of only one LoadBalancer
per cluster at the moment. Yet, it can turn out to get problematic for
any kind of automation.

As such, we're exposing the hostname together with the IP. This also
removes a lot of the code introduced in #355 and moves the code to its
previous implementation.

Closes: ANXKUBE-1280
See also: ANXKUBE-1251, #355
nachtjasmin added a commit that referenced this pull request Jan 15, 2025
Because the IP of the LoadBalancer Service is no longer exposed, it would
get harder to setup DNS records. The current workaround would be:

 * Wait for the LoadBalancer to be reconciled without the annotation.
 * Write down the IP address to configure it elsewhere.
 * Annotate the service.

This only works because there's a limitation of only one LoadBalancer
per cluster at the moment. Yet, it can turn out to get problematic for
any kind of automation.

As such, we're exposing the hostname together with the IP. This also
removes a lot of the code introduced in #355 and moves the code to its
previous implementation.

Closes: ANXKUBE-1280
See also: ANXKUBE-1251, #355
nachtjasmin added a commit that referenced this pull request Jan 15, 2025
Because the IP of the LoadBalancer Service is no longer exposed, it would
get harder to setup DNS records. The current workaround would be:

 * Wait for the LoadBalancer to be reconciled without the annotation.
 * Write down the IP address to configure it elsewhere.
 * Annotate the service.

This only works because there's a limitation of only one LoadBalancer
per cluster at the moment. Yet, it can turn out to get problematic for
any kind of automation.

As such, we're exposing the hostname together with the IP. This also
removes a lot of the code introduced in #355 and moves the code to its
previous implementation.

Closes: ANXKUBE-1280
See also: ANXKUBE-1251, #355
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