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

fix ovn lb gc #2728

Merged
merged 2 commits into from
Apr 27, 2023
Merged

fix ovn lb gc #2728

merged 2 commits into from
Apr 27, 2023

Conversation

zhangzujian
Copy link
Member

@zhangzujian zhangzujian commented Apr 27, 2023

What type of this PR

  • Bug fixes
  • Performance

Which issue(s) this PR fixes:

  1. Fix ovn lb vip gc in dual-stack clusters;
  2. Improve ovn lb gc performance.

WHAT

🤖 Generated by Copilot at 37b4454

This pull request enhances the garbage collection of load balancers and adds support for dual-stack services. It refactors the gcLoadBalancer function in pkg/controller/gc.go to use more efficient data structures and log more information. It also introduces a new helper function ServiceClusterIPs in pkg/util/k8s.go to get the cluster IPs of a service.

🤖 Generated by Copilot at 37b4454

Sing, O Muse, of the skillful coder who devised
A clever helper function, ServiceClusterIPs, to slice
The cluster IPs of services, whether one or two or none,
And handle dual-stack cases, both of IPv4 and IPv6.

HOW

🤖 Generated by Copilot at 37b4454

  • Import time package and record start time of gcLoadBalancer function (link, link)
  • Refactor logic of collecting VIPs of services for load balancers using maps and sets, and use ServiceClusterIPs helper function to handle dual-stack services (link, link)
  • Add log messages and simplify conditions for deleting VIPs from TCP, TCP session, UDP, and UDP session load balancers using ok idiom (link, link, link, link)
  • Add log message to indicate elapsed time of gcLoadBalancer function (link)

@zhangzujian zhangzujian added bug Something isn't working performance Anything that can make Kube-OVN faster labels Apr 27, 2023
@zhangzujian zhangzujian marked this pull request as ready for review April 27, 2023 08:00
@zhangzujian zhangzujian requested a review from oilbeater April 27, 2023 08:00
@zhangzujian zhangzujian merged commit af16c76 into kubeovn:release-1.9 Apr 27, 2023
@zhangzujian zhangzujian deleted the fix-gc-lb branch April 27, 2023 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working performance Anything that can make Kube-OVN faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants