{"modulePath":"github.com/stackpointcloud/kubernetes","version":"v1.3.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package scheduler\n\n## Constants\n\n```go\nconst (\n\tDefaultExtenderTimeout = 5 * time.Second\n)\n```\n\n## Variables\n\n```go\nvar ErrNoNodesAvailable = fmt.Errorf(\"no nodes available to schedule pods\")\n```\n\n## Functions\n\n```go\nfunc EqualPriority(_ *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister algorithm.NodeLister) (schedulerapi.HostPriorityList, error)\n```\nEqualPriority is a prioritizer function that gives an equal weight of one to all nodes\n\n```go\nfunc NewGenericScheduler(cache schedulercache.Cache, predicates map[string]algorithm.FitPredicate, prioritizers []algorithm.PriorityConfig, extenders []algorithm.SchedulerExtender) algorithm.ScheduleAlgorithm\n```\n\n```go\nfunc NewHTTPExtender(config *schedulerapi.ExtenderConfig, apiVersion string) (algorithm.SchedulerExtender, error)\n```\n\n```go\nfunc PrioritizeNodes(\n\tpod *api.Pod,\n\tnodeNameToInfo map[string]*schedulercache.NodeInfo,\n\tpriorityConfigs []algorithm.PriorityConfig,\n\tnodeLister algorithm.NodeLister,\n\textenders []algorithm.SchedulerExtender,\n) (schedulerapi.HostPriorityList, error)\n```\nPrioritizes the nodes by running the individual priority functions in parallel. Each priority function is expected to set a score of 0-10 0 is the lowest priority score (least preferred node) and 10 is the highest Each priority function can also have its own weight The node scores returned by the priority function are multiplied by the weights to get weighted scores All scores are finally combined (added) to get the total weighted scores of all nodes\n\n## Types\n\n```go\ntype Binder interface {\n\tBind(binding *api.Binding) error\n}\n```\nBinder knows how to write a binding.\n\n```go\ntype Config struct {\n\t// It is expected that changes made via SchedulerCache will be observed\n\t// by NodeLister and Algorithm.\n\tSchedulerCache schedulercache.Cache\n\tNodeLister     algorithm.NodeLister\n\tAlgorithm      algorithm.ScheduleAlgorithm\n\tBinder         Binder\n\t// PodConditionUpdater is used only in case of scheduling errors. If we succeed\n\t// with scheduling, PodScheduled condition will be updated in apiserver in /bind\n\t// handler so that binding and setting PodCondition it is atomic.\n\tPodConditionUpdater PodConditionUpdater\n\n\t// NextPod should be a function that blocks until the next pod\n\t// is available. We don't use a channel for this, because scheduling\n\t// a pod may take some amount of time and we don't want pods to get\n\t// stale while they sit in a channel.\n\tNextPod func() *api.Pod\n\n\t// Error is called if there is an error. It is passed the pod in\n\t// question, and the error\n\tError func(*api.Pod, error)\n\n\t// Recorder is the EventRecorder to use\n\tRecorder record.EventRecorder\n\n\t// Close this to shut down the scheduler.\n\tStopEverything chan struct{}\n}\n```\n\n```go\ntype FailedPredicateMap map[string]string\n```\n\n```go\ntype FitError struct {\n\tPod              *api.Pod\n\tFailedPredicates FailedPredicateMap\n}\n```\n\n```go\nfunc (f *FitError) Error() string\n```\nError returns detailed information of why the pod failed to fit on each node\n\n```go\ntype HTTPExtender struct {\n\t// contains filtered or unexported fields\n}\n```\nHTTPExtender implements the algorithm.SchedulerExtender interface.\n\n```go\nfunc (h *HTTPExtender) Filter(pod *api.Pod, nodes *api.NodeList) (*api.NodeList, error)\n```\nFilter based on extender implemented predicate functions. The filtered list is expected to be a subset of the supplied list.\n\n```go\nfunc (h *HTTPExtender) Prioritize(pod *api.Pod, nodes *api.NodeList) (*schedulerapi.HostPriorityList, int, error)\n```\nPrioritize based on extender implemented priority functions. Weight\\*priority is added up for each such priority function. The returned score is added to the score computed by Kubernetes scheduler. The total score is used to do the host selection.\n\n```go\ntype PodConditionUpdater interface {\n\tUpdate(pod *api.Pod, podCondition *api.PodCondition) error\n}\n```\n\n```go\ntype Scheduler struct {\n\t// contains filtered or unexported fields\n}\n```\nScheduler watches for new unscheduled pods. It attempts to find nodes that they fit on and writes bindings back to the api server.\n\n```go\nfunc New(c *Config) *Scheduler\n```\nNew returns a new scheduler.\n\n```go\nfunc (s *Scheduler) Run()\n```\nRun begins watching and scheduling. It starts a goroutine and returns immediately.\n\n","path":"github.com/stackpointcloud/kubernetes/plugin/pkg/scheduler","name":"scheduler","synopsis":"","isRedistributable":true}
