-
Notifications
You must be signed in to change notification settings - Fork 39k
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
[Federation] Convert the deployment controller to a sync controller. #46260
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
6020af5
to
d8066a6
Compare
/assign @marun |
@k8s-bot pull-kubernetes-federation-e2e-gce test this |
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.
Change seems straightforward to me. Tests should be passing before lgtm.
deploymentController := deploymentcontroller.NewDeploymentController(deploymentClientset) | ||
glog.V(3).Infof("Running deployment controller") | ||
// TODO: rename s.ConcurrentReplicaSetSyncs | ||
go deploymentController.Run(s.ConcurrentReplicaSetSyncs, wait.NeverStop) |
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.
Is s.ConcurrentReplicaSetSyncs
no longer relevant?
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.
It is no longer relevant: it could be reintroduced in a future PR, but I haven't seen any evidence that it's useful.
Removing it as a flag could be interesting, since it's a breaking change to remove it. It's probably not a huge deal, since I don't think most people are running the controller manager themselves, but it's something we do need to think about. It's functionally harmless to leave it, though it's misleading.
@@ -22,6 +22,7 @@ import ( | |||
"time" | |||
|
|||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
pkgruntime "k8s.io/apimachinery/pkg/runtime" |
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.
Should this file become scheduling_test.go?
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.
That makes sense. Done.
@k8s-bot pull-kubernetes-e2e-kops-aws test this |
@perotinus ReplicaSet has merged! Happy to review this once you rebase. |
@marun Hold off on reviewing this for now: there are some issues with testing I need to work out still. I'll ping the PR when it's ready. Thanks! |
@marun OK, the tests are fixed. This should be ready for review now. |
/retest |
/test pull-kubernetes-e2e-gce-etcd3 |
As per inline comment, I'm not sure reflection is the best strategy to provide type-agnostic scheduling, but otherwise this looks reasonable. Reviewed 14 of 14 files at r1. federation/pkg/federatedtypes/scheduling.go, line 94 at r1 (raw file):
Why is reflection preferable to using adapter methods to retrieve the relevant fields? federation/pkg/federatedtypes/scheduling.go, line 99 at r1 (raw file):
I think it would be preferable to use the meta accessor to access federation/pkg/federatedtypes/scheduling.go, line 102 at r1 (raw file):
current what? federation/pkg/federatedtypes/scheduling.go, line 107 at r1 (raw file):
Consider simplifying this logic e.g.
Comments from Reviewable |
Review status: all files reviewed at latest revision, 4 unresolved discussions. federation/pkg/federatedtypes/scheduling.go, line 94 at r1 (raw file): Previously, marun (Maru Newby) wrote…
I played around with this for a little while. Right now, my impression is that the reflection is not that pretty but that having the code to get the spec/status/etc in different places is harder to follow and reason about. Also, some of the pure functions not on the adapter currently use reflection to get info from the objects; they would either have to have an adapter passed in, or have more functions passed in to get what they need from an object, which makes their interfaces more complicated without much benefit IMO. I can play with this some more–the option that I would choose in place of reflection would be several functions passed into the scheduling adapter and stored on it–but I don't think that's a cleaner way to do it than the reflection that's here. federation/pkg/federatedtypes/scheduling.go, line 99 at r1 (raw file): Previously, marun (Maru Newby) wrote…
Ah, yes. I'd seen that before but had forgotten about it. Changed. federation/pkg/federatedtypes/scheduling.go, line 102 at r1 (raw file): Previously, marun (Maru Newby) wrote…
Done. federation/pkg/federatedtypes/scheduling.go, line 107 at r1 (raw file): Previously, marun (Maru Newby) wrote…
Done. Comments from Reviewable |
/retest |
/lgtm Reviewed 2 of 2 files at r3. Comments from Reviewable |
/retest |
@perotinus: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest |
/approve |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: csbell, marun, nikhiljindal, perotinus No associated issue. Update pull-request body to add a reference to an issue, or get approval with The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 47619, 47951, 46260, 48277) |
This is based off of the work done for the ReplicaSet controller. It extracts out a schedulingAdapter that handles the shared logic between the two controllers.
Targets #40989
Release note: