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

Remove EnsureLB from ClusterManager #406

Merged
merged 1 commit into from
Jul 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions pkg/controller/cluster_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,6 @@ func (c *ClusterManager) shutdown() error {
return c.backendPool.Shutdown()
}

// EnsureLoadBalancer creates the backend services and higher-level LB resources.
// - lb is the single cluster L7 loadbalancers we wish to exist. If they already
// exist, they should not have any broken links between say, a UrlMap and
// TargetHttpProxy.
// - lbServicePorts are the ports for which we require Backend Services.
// - igLinks are the links to the groups to be referenced by the Backend Services.
// If GCE runs out of quota, a googleapi 403 is returned.
func (c *ClusterManager) EnsureLoadBalancer(lb *loadbalancers.L7RuntimeInfo, lbServicePorts []utils.ServicePort, igLinks []string) error {
glog.V(4).Infof("EnsureLoadBalancer(%q lb, %v lbServicePorts, %v instanceGroups)", lb.String(), len(lbServicePorts), len(igLinks))
if err := c.backendPool.Ensure(uniq(lbServicePorts), igLinks); err != nil {
return err
}

return c.l7Pool.Sync(lb)
}

func (c *ClusterManager) EnsureInstanceGroupsAndPorts(nodeNames []string, servicePorts []utils.ServicePort) ([]*compute.InstanceGroup, error) {
// Convert to slice of NodePort int64s.
ports := []int64{}
Expand Down
10 changes: 7 additions & 3 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,13 @@ func (lbc *LoadBalancerController) ensureIngress(ing *extensions.Ingress, nodeNa
}
lb.UrlMap = urlMap

// Create the backend services and higher-level LB resources.
// Note: To ensure the load balancer, we only need the IG links.
if err = lbc.CloudClusterManager.EnsureLoadBalancer(lb, ingSvcPorts, utils.IGLinks(igs)); err != nil {
// Create the backends. Note that we only need the IG links.
if err := lbc.CloudClusterManager.backendPool.Ensure(uniq(ingSvcPorts), utils.IGLinks(igs)); err != nil {
return err
}

// Create higher-level LB resources.
if err := lbc.CloudClusterManager.l7Pool.Sync(lb); err != nil {
return err
}

Expand Down