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

Support LoadBalancerClass in Services #832

Open
EternalDeiwos opened this issue Dec 21, 2024 · 3 comments
Open

Support LoadBalancerClass in Services #832

EternalDeiwos opened this issue Dec 21, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@EternalDeiwos
Copy link

EternalDeiwos commented Dec 21, 2024

TL;DR

Following #338; figured posting a new issue was better than thread-necro.

It would be very helpful for CCM to have a loadBalancerClass defined, because I am pretty sure that every other LB implementation out there is going to assume they are the "default". At least Cilium does.

Picking between load balancers is done with the .spec.loadBalancerClass field. When LB IPAM is enabled it allocates and assigns IPs for services with no load balancer class set.

cc @apricote

Expected behavior

I should be able to specify a value for loadBalancerClass to explicitly select a HCCM load balancer.

@EternalDeiwos EternalDeiwos added the enhancement New feature or request label Dec 21, 2024
@lukasmetzner
Copy link
Contributor

lukasmetzner commented Jan 14, 2025

Correct me if I am wrong here, but I think the loadBalancerClass value should be used to select certain implementations, rather than exclude them.

According to the docs:

If you specify .spec.loadBalancerClass, it is assumed that a load balancer implementation that matches the specified class is watching for Services.

Or would you prefer to configure the HCCM to target only services that have a specific spec.loadBalancerClass defined? I don't think this is possible due to the implementations of the cloud-provider interface we implement.

Best Regards,
Lukas

@EternalDeiwos
Copy link
Author

EternalDeiwos commented Jan 14, 2025

My situation is that I have two implementations of load balancers in my cluster, HCM (this project) and Cilium; and both will attempt to claim services that do not have .spec.loadBalancerClass set. If I want to ensure the Cilium implementation is used for a given load balancer, then I can do that by specifying which type in the field. I cannot do the same with HCM because there is no valid value for loadBalancerClass except empty, which creates a race. This effectively means that I am currently unable to create Hetzner load balancers.

Also regarding "exclusion", any selection like this inherently excludes things that are not within the selection, e.g. using nodeSelector from the PodSpec by definition excludes nodes that do not match the provided labels. This is the behaviour I would like where I can choose one implementation to exclude the other.

Ideally it would also be nice to configure the behaviour of HCM such that it also does not assume it is the default LoadBalancer implementation but I can live without that if I am able to explicitly tell services to use specific LoadBalancer implementations

@lukasmetzner
Copy link
Contributor

I will bring this topic to our discussion next week. But I am afraid that we probably can not change the behavior much, as it seems to be hard coded in the cloud-provider library, that we only create LBs with an empty value for loadBalancerClass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants