{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11470","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11470/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11470/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11470/events","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/issues/11470","id":95747533,"number":11470,"title":"Scheduler extension Proposal","user":{"login":"ravigadde","id":3618819,"avatar_url":"https://avatars.githubusercontent.com/u/3618819?v=3","gravatar_id":"","url":"https://api.github.com/users/ravigadde","html_url":"https://github.com/ravigadde","followers_url":"https://api.github.com/users/ravigadde/followers","following_url":"https://api.github.com/users/ravigadde/following{/other_user}","gists_url":"https://api.github.com/users/ravigadde/gists{/gist_id}","starred_url":"https://api.github.com/users/ravigadde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ravigadde/subscriptions","organizations_url":"https://api.github.com/users/ravigadde/orgs","repos_url":"https://api.github.com/users/ravigadde/repos","events_url":"https://api.github.com/users/ravigadde/events{/privacy}","received_events_url":"https://api.github.com/users/ravigadde/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels/area/extensibility","name":"area/extensibility","color":"ffaa04"},{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels/area/scheduling","name":"area/scheduling","color":"ab6420"},{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels/priority/P2","name":"priority/P2","color":"fbca04"},{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels/team/master","name":"team/master","color":"d2b48c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-07-17T21:18:41Z","updated_at":"2015-08-11T17:09:58Z","closed_at":null,"body":"Kubernetes scheduler schedules based on resources managed by Kubernetes. Scheduling based on opaque resource counting helps extending this further. But when there is a need for contextual scheduling for resources managed outside of kubernetes(example: place a pod where its storage is), there is no mechanism to do it today.\r\n\r\nThe proposal is to make kubernetes scheduler extensible by adding the capability to make http calls out to another endpoint to help achieve this functionality. I am curious whether you think the cloud provider abstraction is the right abstraction for implementation.\r\n\r\nHere is a rough draft of what I am thinking about. Would like to solicit community feedback\r\n\r\n```\r\ntype SchedulerExtension interface {\r\n\r\n      // Filter based on provider implemented predicate functions.\r\n      Filter(pod *api.Pod, nodes *api.NodeList) (*api.NodeList, error)\r\n\r\n      // Prioritize based on provider implemented priority functions. Weight*priority is added up for each\r\n      // such priority function. The returned score is added to the score computed by Kubernetes\r\n      // scheduler. The total score is used to do the host selection.\r\n      Prioritize(pod *api.Pod, nodes *api.NodeList) (*scheduler/api.HostPriorityList, error)\r\n\r\n      // Inform the provider about the scheduling decision. This could also be done by the provider\r\n      // watching apiserver pods/binding endpoint.\r\n      Bind(pod *api.Pod, host string) error\r\n\r\n      // Inform the provider about the unbind. To be called by apiserver in pod deletion path. This could\r\n      // also be accomplished by watching apiserver pods endpoint.\r\n      Unbind(pod *api.Pod, host string) error\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/comments/129972829","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/issues/11470#issuecomment-129972829","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11470","id":129972829,"user":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"created_at":"2015-08-11T17:09:58Z","updated_at":"2015-08-11T17:09:58Z","body":"Sorry, @ravigadde. Still digging out of the pre-1.0 backlog.\r\n\r\nI have a few quick comments:\r\n1. Scheduler extensions should not be tied to cloudprovider in any way. There are many reasons why people might want to extend the scheduler.\r\n2. We have existing mechanisms for adding new filtering and prioritization passes. Why not just use/improve them? Then you'd just need to add bind/unbind hooks.\r\n3. FYI/FWIW, we plan on making significant changes to the scheduler, for performance/scale, improvements in the way prioritization works, and in order to take observed resource usage into account. You could continue to develop on the current implementation in the meantime, but we may fork or rewrite it."}}