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

Feature request: support for loadBalancerClass #61

Closed
EmielBruijntjes opened this issue May 20, 2023 · 5 comments · Fixed by #100
Closed

Feature request: support for loadBalancerClass #61

EmielBruijntjes opened this issue May 20, 2023 · 5 comments · Fixed by #100

Comments

@EmielBruijntjes
Copy link

Would it be possible to have the provider check the "loadBalancerClass", so that it only assigns IP addresses to matching services? For example by setting an environment variable "KUBEVIP_LB_CLASS" (or so).

@lubronzhan
Copy link
Collaborator

Yeah that sounds reasonable
Right now kube-vip supports this field

Kubernetes LoadBalancer Class (Kubernetes v1.24+) (kube-vip v0.5.0+)
The watcher will always examine the [load balancer class ](https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class), and if it isn't set then will assume that classes aren't being set and act upon the service. If the spec.loadBalancerClass has been set in the service spec then kube-vip will only act IF the spec has been set to:

spec.loadBalancerClass=kube-vip.io/kube-vip-class.

And kube-vip loadbalancer should also honer it if they are used together

@lubronzhan
Copy link
Collaborator

Summarizing the functionality here

  1. If service has loadbalancerClass, kube-vip-cloud-provider is not configured with loadbalancerClass, kube-vip-cloud-provider will ignore the service
  2. If service doesn't have loadbalancerClass, kube-vip-cloud-provider is configured with loadbalancerClass, kube-vip-
    cloud-provider will ignore the service
  3. If service has loadbalancerClass, kube-vip-cloud-provider is configured with loadbalancerClass, kube-vip-
    cloud-provider will allocate ip for the service
  4. If service doesn't have loadbalancerClass, kube-vip-cloud-provider is not configured with loadbalancerClass, kube-vip-
    cloud-provider will allocate ip for the service

@lubronzhan
Copy link
Collaborator

Found problem with the implementation, since default cluod-provider won't reconcile service if it has loadbalancerClass set

https://github.com/kubernetes/cloud-provider/blob/982d74ad51fe6a37157eb20dd1386be1a2a0f106/controllers/service/controller.go#L824-L827

Need to come up with other way

@EmielBruijntjes
Copy link
Author

@lubronzhan does this still have your attention, or can we better look for an alternative way to achieve this?

@lubronzhan
Copy link
Collaborator

Now it's supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants