-
Notifications
You must be signed in to change notification settings - Fork 301
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
Refactor to remove ClusterManager completely #422
Conversation
/assign @bowei |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor stuff
pkg/controller/controller.go
Outdated
instancePool: instances.NewNodePool(ctx.Cloud, ctx.ClusterNamer), | ||
l7Pool: loadbalancers.NewLoadBalancerPool(ctx.Cloud, ctx.ClusterNamer), | ||
} | ||
healthChecker := healthchecks.NewHealthChecker(ctx.Cloud, ctx.HealthCheckPath, ctx.DefaultBackendHealthCheckPath, ctx.ClusterNamer, ctx.DefaultBackendSvcPortID.Service) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this could be:
healthChecker := healthchecks.NewHealthChecker(ctx.Cloud, ctx.HealthCheckPath, ctx.DefaultBackendHealthCheckPath, ctx.ClusterNamer, ctx.DefaultBackendSvcPortID.Service)
instancePool := instances.NewNodePool(ctx.Cloud, ctx.ClusterNamer)
backendPool := backends.NewBackendPool(ctx.Cloud, ctx.Cloud, healthChecker, instancePool, ctx.ClusterNamer, ctx.BackendConfigEnabled, true)
lbc := LoadBalancerController{
...
nodes: NewNodeController(ctx, lbc.instancePool),
backendPool: backendPool,
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
pkg/controller/controller.go
Outdated
lbc.Translator = translator.NewTranslator(lbc.CloudClusterManager.ClusterNamer, lbc.ctx) | ||
lbc.Translator = translator.NewTranslator(lbc.ctx) | ||
// TODO(rramkumar): Try to get rid of this "Init". | ||
lbc.instancePool.Init(lbc.Translator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to lbc.Init()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
pkg/controller/controller.go
Outdated
@@ -175,7 +183,11 @@ func NewLoadBalancerController( | |||
}) | |||
} | |||
|
|||
lbc.Translator = translator.NewTranslator(lbc.CloudClusterManager.ClusterNamer, lbc.ctx) | |||
lbc.Translator = translator.NewTranslator(lbc.ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add this to the lbc decl above Translator: ctx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
pkg/controller/controller.go
Outdated
// TODO(rramkumar): Try to get rid of this "Init". | ||
lbc.instancePool.Init(lbc.Translator) | ||
lbc.backendPool.Init(lbc.Translator) | ||
|
||
lbc.tlsLoader = &tls.TLSCertsFromSecretsLoader{Client: lbc.client} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same , move into lbc decl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -25,12 +25,10 @@ import ( | |||
api_v1 "k8s.io/api/core/v1" | |||
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
"k8s.io/apimachinery/pkg/types" | |||
"k8s.io/apimachinery/pkg/util/sets" | |||
//"k8s.io/apimachinery/pkg/util/sets" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out for now since its used in the test I commented out
@@ -63,9 +60,10 @@ func TestZoneListing(t *testing.T) { | |||
} | |||
} | |||
|
|||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep track of this so we don't forget..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I'm going to fix it in a followup soon.
f78902a
to
e856849
Compare
e856849
to
7c341b5
Compare
This PR removes the ClusterManager completely from existence. All resource pools that were managed in the ClusterManager are now directly managed by the LB controller. Furthermore, all wrapper functions (EnsureInstanceGroupsAndPorts) are implemented by the LB controller itself.
Note: Still need to figure out unit test failure.
/assign @bowei