{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/6520","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/6520/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/6520/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/6520/events","html_url":"https://github.com/kubernetes/kubernetes/pull/6520","id":66942906,"number":6520,"title":"Controller Plugin framework","user":{"login":"markturansky","id":8001968,"avatar_url":"https://avatars.githubusercontent.com/u/8001968?v=3","gravatar_id":"","url":"https://api.github.com/users/markturansky","html_url":"https://github.com/markturansky","followers_url":"https://api.github.com/users/markturansky/followers","following_url":"https://api.github.com/users/markturansky/following{/other_user}","gists_url":"https://api.github.com/users/markturansky/gists{/gist_id}","starred_url":"https://api.github.com/users/markturansky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markturansky/subscriptions","organizations_url":"https://api.github.com/users/markturansky/orgs","repos_url":"https://api.github.com/users/markturansky/repos","events_url":"https://api.github.com/users/markturansky/events{/privacy}","received_events_url":"https://api.github.com/users/markturansky/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cla:%20yes","name":"cla: yes","color":"bfe5bf"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/XL","name":"size/XL","color":"ee5500"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/team/cluster","name":"team/cluster","color":"d2b48c"}],"state":"open","locked":false,"assignee":{"login":"thockin","id":5595220,"avatar_url":"https://avatars.githubusercontent.com/u/5595220?v=3","gravatar_id":"","url":"https://api.github.com/users/thockin","html_url":"https://github.com/thockin","followers_url":"https://api.github.com/users/thockin/followers","following_url":"https://api.github.com/users/thockin/following{/other_user}","gists_url":"https://api.github.com/users/thockin/gists{/gist_id}","starred_url":"https://api.github.com/users/thockin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thockin/subscriptions","organizations_url":"https://api.github.com/users/thockin/orgs","repos_url":"https://api.github.com/users/thockin/repos","events_url":"https://api.github.com/users/thockin/events{/privacy}","received_events_url":"https://api.github.com/users/thockin/received_events","type":"User","site_admin":false},"milestone":null,"comments":44,"created_at":"2015-04-07T17:24:00Z","updated_at":"2015-09-15T02:52:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/6520","html_url":"https://github.com/kubernetes/kubernetes/pull/6520","diff_url":"https://github.com/kubernetes/kubernetes/pull/6520.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/6520.patch"},"body":"This is a sketch for discussion.  I'm curious to know if this is a desirable direction for kube-controller-manager.\r\n\r\nGoals:\r\n\r\n1.  Change controllers into plugins.  Each is similar in implementation.  Make a framework to run many plugins in kube-controller-manager.  Plugin arch copied from VolumePlugin and NetworkPlugin.\r\n2.  Be ready to support @lavalamp's Controller Framework (#5270)\r\n3.  Port 1 controller (i used EndpointsController) as an example.\r\n4.  Future enhancements:\r\n  1. Potentially change kube-controller-manager into a server to allow queries into its status.  The manager can query each of its controllers and report back on each of them.\r\n  2. Allow graceful shutdown of all controllers via stop channels (Smith's Controller Framework has a similar stop mechanism)\r\n  3. Allow set/override default sync values (defaults set by plugins, override by CLI flags)\r\n  4. Refactor CLI sync flags to allow plugin to add these somehow, as opposed to explicitly adding each.\r\n\r\nOptional:  Potentially rename all controllers to something akin to \"*Manager\" or \"*Synchronizer\" to differentiate a process from a kind.  Example:  PersistentVolumeManager is the sync loop.  PersistentVolumeController is a proposed Kind in the API that makes new PVs.\r\n\r\nGenesis: I wrote a controller in which I thought I needed to reconcile 2 objects and didn't like the duplication required.  It wasn't hard to genericize, after which I thought I'd take a shot at making all controllers work similarly.  Porting endpoints_controller was very easy to do.  \r\n\r\n@thockin @bgrant0607 "},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/140262285","html_url":"https://github.com/kubernetes/kubernetes/pull/6520#issuecomment-140262285","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/6520","id":140262285,"user":{"login":"markturansky","id":8001968,"avatar_url":"https://avatars.githubusercontent.com/u/8001968?v=3","gravatar_id":"","url":"https://api.github.com/users/markturansky","html_url":"https://github.com/markturansky","followers_url":"https://api.github.com/users/markturansky/followers","following_url":"https://api.github.com/users/markturansky/following{/other_user}","gists_url":"https://api.github.com/users/markturansky/gists{/gist_id}","starred_url":"https://api.github.com/users/markturansky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markturansky/subscriptions","organizations_url":"https://api.github.com/users/markturansky/orgs","repos_url":"https://api.github.com/users/markturansky/repos","events_url":"https://api.github.com/users/markturansky/events{/privacy}","received_events_url":"https://api.github.com/users/markturansky/received_events","type":"User","site_admin":false},"created_at":"2015-09-15T02:52:05Z","updated_at":"2015-09-15T02:52:05Z","body":"@lavalamp thanks for all the feedback.  I see a few good reasons for this PR.  None earth shattering, but I think overall in the right direction.\r\n\r\n1.  controllermanager.go becomes smaller and simpler.  It's currently all bespoke initialization of controllers line after line.  Plugins would reduce that dramatically. \r\n\r\n2.  This PR provides a common runtime for all controllers and common start/stop mechanics.  Controllers are already similar to each other.  This would make them more so.\r\n\r\n3.  There's no way today of knowing what controllers are running and their health.  The binary can be made into a server (more like kubelet) and it's status could be queried at runtime to view all controllers' health.  Can't do that today.  Might be useful to an admin running a cluster.  Perhaps controllers can collect their own stats and provide them in Status.   \r\n\r\nThat last one is difficult to do without the common runtime."}}