package scheduler
import "k8s.io/kubernetes/plugin/pkg/scheduler"
Index ¶
- type Binder
- type Config
- type ExtendedPodLister
- type FakeModeler
- type Scheduler
- type SimpleModeler
- func NewSimpleModeler(queuedPods, scheduledPods ExtendedPodLister) *SimpleModeler
- func (s *SimpleModeler) AssumePod(pod *api.Pod)
- func (s *SimpleModeler) PodLister() algorithm.PodLister
- type SystemModeler
Types ¶
type Binder ¶
Binder knows how to write a binding.
type Config ¶
type Config struct { // It is expected that changes made via modeler will be observed // by MinionLister and Algorithm. Modeler SystemModeler MinionLister scheduler.MinionLister Algorithm scheduler.Scheduler Binder Binder // NextPod should be a function that blocks until the next pod // is available. We don't use a channel for this, because scheduling // a pod may take some amount of time and we don't want pods to get // stale while they sit in a channel. NextPod func() *api.Pod // Error is called if there is an error. It is passed the pod in // question, and the error Error func(*api.Pod, error) // Recorder is the EventRecorder to use Recorder record.EventRecorder }
type ExtendedPodLister ¶
ExtendedPodLister: SimpleModeler needs to be able to check for a pod's existance in addition to listing the pods.
type FakeModeler ¶
FakeModeler implements the SystemModeler interface.
func (*FakeModeler) AssumePod ¶
func (f *FakeModeler) AssumePod(pod *api.Pod)
AssumePod calls the function variable if it is not nil.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler watches for new unscheduled pods. It attempts to find minions that they fit on and writes bindings back to the api server.
func New ¶
New returns a new scheduler.
func (*Scheduler) Run ¶
func (s *Scheduler) Run()
Run begins watching and scheduling. It starts a goroutine and returns immediately.
type SimpleModeler ¶
type SimpleModeler struct {
// contains filtered or unexported fields
}
SimpleModeler implements the SystemModeler interface with a timed pod cache.
func NewSimpleModeler ¶
func NewSimpleModeler(queuedPods, scheduledPods ExtendedPodLister) *SimpleModeler
NewSimpleModeler returns a new SimpleModeler.
queuedPods: a PodLister that will return pods that have not been scheduled yet. scheduledPods: a PodLister that will return pods that we know for sure have been scheduled.
func (*SimpleModeler) AssumePod ¶
func (s *SimpleModeler) AssumePod(pod *api.Pod)
func (*SimpleModeler) PodLister ¶
func (s *SimpleModeler) PodLister() algorithm.PodLister
PodLister returns a PodLister that will list pods that we think we have scheduled in addition to pods that we know have been scheduled.
type SystemModeler ¶
type SystemModeler interface { // AssumePod assumes that the given pod exists in the system. // The assumtion should last until the system confirms the // assumtion or disconfirms it. AssumePod(pod *api.Pod) }
SystemModeler can help scheduler produce a model of the system that anticipates reality. For example, if scheduler has pods A and B both using hostPort 80, when it binds A to machine M it should not bind B to machine M in the time when it hasn't observed the binding of A take effect yet.
Since the model is only an optimization, it's expected to handle any errors itself without sending them back to the scheduler.
Source Files ¶
modeler.go scheduler.go
Directories ¶
Path | Synopsis |
---|---|
plugin/pkg/scheduler/algorithmprovider | This package is used to register algorithm provider plugins. |
plugin/pkg/scheduler/algorithmprovider/defaults | This is the default algorithm provider for the scheduler. |
plugin/pkg/scheduler/api | |
plugin/pkg/scheduler/api/latest | |
plugin/pkg/scheduler/api/v1 | |
plugin/pkg/scheduler/factory | Package factory can set up a scheduler. |
- Version
- v0.13.1-dev
- Published
- Mar 16, 2015
- Platform
- js/wasm
- Imports
- 9 packages
- Last checked
- 47 seconds ago –
Tools for package owners.