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

WIP: Harvester load balancer enhancement #8

Closed
wants to merge 4 commits into from

Conversation

yaocw2020
Copy link
Contributor

@yaocw2020 yaocw2020 commented Apr 2, 2022

  • Add ipam module(crd, controller, webhook)
  • Define two types of LB, one for the VM workload, the other for the guest cluster
  • Support changing the IPAM mode
  • Add load balancer converter webhook

Related issue:
harvester/harvester#1762
harvester/harvester#1580

design document:
harvester/harvester#1913

Dependency:
harvester/harvester#3776
harvester/webhook#3

@yaocw2020 yaocw2020 changed the title Harvester load balancer enhancement [WIP] Harvester load balancer enhancement Apr 7, 2022
@yaocw2020 yaocw2020 force-pushed the enhancement branch 4 times, most recently from 2a11e16 to 7395c59 Compare April 8, 2022 12:08
@yaocw2020 yaocw2020 changed the title [WIP] Harvester load balancer enhancement Harvester load balancer enhancement Apr 8, 2022
@yaocw2020 yaocw2020 force-pushed the enhancement branch 2 times, most recently from bc82dd8 to 66f3219 Compare April 27, 2022 04:59
}
logrus.Infof("VMI %s has been changed", vmi.Name)

lbs, err := h.lbCache.List("", labels.Everything())
Copy link
Member

Choose a reason for hiding this comment

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

only list ! lbv1.Cluster or lbv1.VM will be efficiency

return nil, nil
}

lbs, err := h.lbCache.List("", labels.Everything())
Copy link
Member

Choose a reason for hiding this comment

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

similar


for _, lb := range lbs {
// remove the backend server from the load balancers
if err := h.removeServerFromLB(vmi, lb); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

re-use matchBackendServers to check if this vmi is in the list at first ?

potential efficiency problem here:
(1) the vmi may have no relationship with any lb, but all lb (all endpoints) will be checked; if later m.endpointSliceCache.Get(lb.Namespace, lb.Name) fail, it will return error, but this lb may be irrelevant at all
(2) when there are many lbs...

return nil, err
}

// add or update the backend server to the matched load balancer
Copy link
Member

Choose a reason for hiding this comment

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

vmi changes frequently; for most of the time, it is not related to lb
the lb checks vmi via iterating endpointslice, each time

it seems need a fast way, e.g. lb looks record info of vmi (e.g. id, ip), to have a one step match check

}

if ipPool.Spec.Ranges == nil || len(ipPool.Spec.Ranges) == 0 {
return nil, fmt.Errorf("invalid ip pool, range could not be empty")
Copy link
Member

Choose a reason for hiding this comment

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

As a controller, this file lacks of essential log

@yaocw2020 yaocw2020 force-pushed the enhancement branch 4 times, most recently from 918cd2a to c55533a Compare May 26, 2022 08:26
@guangbochen guangbochen removed the request for review from joshmeranda July 8, 2022 09:10
@yaocw2020 yaocw2020 force-pushed the enhancement branch 3 times, most recently from 82d0c86 to fd49f07 Compare July 19, 2022 04:47
@guangbochen guangbochen removed their request for review July 20, 2022 07:26
@yaocw2020 yaocw2020 force-pushed the enhancement branch 2 times, most recently from 7f65b07 to a82e037 Compare August 28, 2022 06:50
@yaocw2020 yaocw2020 force-pushed the enhancement branch 2 times, most recently from 10860cc to 0f59a4f Compare April 15, 2023 18:24
@yaocw2020 yaocw2020 changed the title Harvester load balancer enhancement WIP: Harvester load balancer enhancement Apr 15, 2023
@yaocw2020
Copy link
Contributor Author

yaocw2020 commented Apr 15, 2023

Need to update vendor after dependency PRs merged.

- Add IP Pool module to support ipam for the load balancer
- Support two workload type load balancer, including VM and cluster
@yaocw2020
Copy link
Contributor Author

close because replaced by PR #13.

@yaocw2020 yaocw2020 closed this Apr 25, 2023
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.

2 participants