{"modulePath":"github.com/squeed/kubernetes","version":"v1.3.6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package algorithm\n\nPackage scheduler contains a generic Scheduler interface and several implementations.\n\n## Types\n\n```go\ntype ControllerLister interface {\n\t// Lists all the replication controllers\n\tList() ([]api.ReplicationController, error)\n\t// Gets the services for the given pod\n\tGetPodControllers(*api.Pod) ([]api.ReplicationController, error)\n}\n```\nControllerLister interface represents anything that can produce a list of ReplicationController; the list is consumed by a scheduler.\n\n```go\ntype EmptyControllerLister struct{}\n```\nEmptyControllerLister implements ControllerLister on \\[]api.ReplicationController returning empty data\n\n```go\nfunc (f EmptyControllerLister) GetPodControllers(pod *api.Pod) (controllers []api.ReplicationController, err error)\n```\nGetPodControllers returns nil\n\n```go\nfunc (f EmptyControllerLister) List() ([]api.ReplicationController, error)\n```\nList returns nil\n\n```go\ntype EmptyReplicaSetLister struct{}\n```\nEmptyReplicaSetLister implements ReplicaSetLister on \\[]extensions.ReplicaSet returning empty data\n\n```go\nfunc (f EmptyReplicaSetLister) GetPodReplicaSets(pod *api.Pod) (rss []extensions.ReplicaSet, err error)\n```\nGetPodReplicaSets returns nil\n\n```go\nfunc (f EmptyReplicaSetLister) List() ([]extensions.ReplicaSet, error)\n```\nList returns nil\n\n```go\ntype FakeControllerLister []api.ReplicationController\n```\nFakeControllerLister implements ControllerLister on \\[]api.ReplicationController for test purposes.\n\n```go\nfunc (f FakeControllerLister) GetPodControllers(pod *api.Pod) (controllers []api.ReplicationController, err error)\n```\nGetPodControllers gets the ReplicationControllers that have the selector that match the labels on the given pod\n\n```go\nfunc (f FakeControllerLister) List() ([]api.ReplicationController, error)\n```\nList returns \\[]api.ReplicationController, the list of all ReplicationControllers.\n\n```go\ntype FakeNodeLister api.NodeList\n```\nFakeNodeLister implements NodeLister on a \\[]string for test purposes.\n\n```go\nfunc (f FakeNodeLister) List() (api.NodeList, error)\n```\nList returns nodes as a \\[]string.\n\n```go\ntype FakePodLister []*api.Pod\n```\nFakePodLister implements PodLister on an \\[]api.Pods for test purposes.\n\n```go\nfunc (f FakePodLister) List(s labels.Selector) (selected []*api.Pod, err error)\n```\nList returns \\[]\\*api.Pod matching a query.\n\n```go\ntype FakeReplicaSetLister []extensions.ReplicaSet\n```\nFakeReplicaSetLister implements ControllerLister on \\[]extensions.ReplicaSet for test purposes.\n\n```go\nfunc (f FakeReplicaSetLister) GetPodReplicaSets(pod *api.Pod) (rss []extensions.ReplicaSet, err error)\n```\nGetPodReplicaSets gets the ReplicaSets that have the selector that match the labels on the given pod\n\n```go\nfunc (f FakeReplicaSetLister) List() ([]extensions.ReplicaSet, error)\n```\nList returns \\[]extensions.ReplicaSet, the list of all ReplicaSets.\n\n```go\ntype FakeServiceLister []api.Service\n```\nFakeServiceLister implements ServiceLister on \\[]api.Service for test purposes.\n\n```go\nfunc (f FakeServiceLister) GetPodServices(pod *api.Pod) (services []api.Service, err error)\n```\nGetPodServices gets the services that have the selector that match the labels on the given pod\n\n```go\nfunc (f FakeServiceLister) List() (api.ServiceList, error)\n```\nList returns api.ServiceList, the list of all services.\n\n```go\ntype FitPredicate func(pod *api.Pod, nodeInfo *schedulercache.NodeInfo) (bool, error)\n```\nFitPredicate is a function that indicates if a pod fits into an existing node. The failure information is given by the error.\n\n```go\ntype NodeLister interface {\n\tList() (list api.NodeList, err error)\n}\n```\nNodeLister interface represents anything that can list nodes for a scheduler.\n\n```go\ntype PodLister interface {\n\t// TODO: make this exactly the same as client's Pods(ns).List() method, by returning a api.PodList\n\tList(labels.Selector) ([]*api.Pod, error)\n}\n```\nPodLister interface represents anything that can list pods for a scheduler.\n\n```go\ntype PriorityConfig struct {\n\tFunction PriorityFunction\n\tWeight   int\n}\n```\n\n```go\ntype PriorityFunction func(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister NodeLister) (schedulerapi.HostPriorityList, error)\n```\n\n```go\ntype ReplicaSetLister interface {\n\t// Lists all the replicasets\n\tList() ([]extensions.ReplicaSet, error)\n\t// Gets the replicasets for the given pod\n\tGetPodReplicaSets(*api.Pod) ([]extensions.ReplicaSet, error)\n}\n```\nReplicaSetLister interface represents anything that can produce a list of ReplicaSet; the list is consumed by a scheduler.\n\n```go\ntype ScheduleAlgorithm interface {\n\tSchedule(*api.Pod, NodeLister) (selectedMachine string, err error)\n}\n```\nScheduleAlgorithm is an interface implemented by things that know how to schedule pods onto machines.\n\n```go\ntype SchedulerExtender interface {\n\t// Filter based on extender-implemented predicate functions. The filtered list is\n\t// expected to be a subset of the supplied list.\n\tFilter(pod *api.Pod, nodes *api.NodeList) (filteredNodes *api.NodeList, err error)\n\n\t// Prioritize based on extender-implemented priority functions. The returned scores \u0026 weight\n\t// are used to compute the weighted score for an extender. The weighted scores are added to\n\t// the scores computed  by Kubernetes scheduler. The total scores are used to do the host selection.\n\tPrioritize(pod *api.Pod, nodes *api.NodeList) (hostPriorities *schedulerapi.HostPriorityList, weight int, err error)\n}\n```\nSchedulerExtender is an interface for external processes to influence scheduling decisions made by Kubernetes. This is typically needed for resources not directly managed by Kubernetes.\n\n```go\ntype ServiceLister interface {\n\t// Lists all the services\n\tList() (api.ServiceList, error)\n\t// Gets the services for the given pod\n\tGetPodServices(*api.Pod) ([]api.Service, error)\n}\n```\nServiceLister interface represents anything that can produce a list of services; the list is consumed by a scheduler.\n\n","path":"github.com/squeed/kubernetes/plugin/pkg/scheduler/algorithm","name":"algorithm","synopsis":"Package scheduler contains a generic Scheduler interface and several implementations.","isRedistributable":true}
