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 for dualstack loadbalancer services #71

Merged
merged 4 commits into from
Dec 31, 2023

Conversation

flawedmatrix
Copy link
Contributor

As a follow-on to kube-vip/kube-vip#687, I've decided to implement handling for dualstack loadbalancer services in kube-vip-cloud-provider by making the following changes:

  • kube-vip.io/loadbalancerIPs may now contain multiple comma-separated IP addresses. This may be a breaking change without the PR from above
  • Pools or ranges in the ConfigMap may now contain mixed IP families and they will be properly partitioned into a IPv4 bucket and an IPv6 bucket internally.
  • kube-vip-cloud-provider now pays special attention to the ipFamilyPolicy field on the Service to determine if dualstack is preferred or required and assigns IPs according to the order specified in the ipFamilies field.

Any comments or concerns welcome!

Signed-off-by: Edwin Xie <exie@vmware.com>
Signed-off-by: Edwin Xie <exie@vmware.com>
if len(secondaryPool) > 0 {
secondaryVip, err := discoverAddress(namespace, secondaryPool, inUseIPSet, descOrder)
if err != nil {
return "", err
Copy link
Collaborator

Choose a reason for hiding this comment

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

Right now if there is not enough ip in the pool, discoverAddress will return error.
Maybe we can make that error a constant, and check here if it's out of IP for secondaryPool and it's preferedDualstack for ipfamilyPolicy, still continue with a warning

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added some handling for this case. Hopefully the changes address all these concerns.

@lubronzhan
Copy link
Collaborator

Nice thought on using the service.spec.ipFamilies and service.spec.ipFamilyPolicy for the indicator of allocating IP.
Could you add more doc about how user can create the service for dual stack? Thanks

Copy link
Contributor

@thebsdbox thebsdbox left a comment

Choose a reason for hiding this comment

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

/lgtm

@thebsdbox thebsdbox merged commit 376a9ba into kube-vip:main Dec 31, 2023
5 checks passed
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