kubernetes: github.com/pranavs18/kubernetes/contrib/mesos/pkg/scheduler Index | Files

package scheduler

import "github.com/pranavs18/kubernetes/contrib/mesos/pkg/scheduler"

Package scheduler implements the Kubernetes Mesos scheduler.

Index

Package Files

doc.go fcfs.go plugin.go pod.go scheduler.go types.go

func FCFSScheduleFunc Uses

func FCFSScheduleFunc(r offers.Registry, unused SlaveIndex, task *podtask.T) (offers.Perishable, error)

A first-come-first-serve scheduler: acquires the first offer that can support the task

type Config Uses

type Config struct {
    Schedcfg          schedcfg.Config
    Executor          *mesos.ExecutorInfo
    ScheduleFunc      PodScheduleFunc
    Client            *client.Client
    EtcdClient        tools.EtcdGetSet
    FailoverTimeout   float64
    ReconcileInterval int64
    ReconcileCooldown time.Duration
}

type KubernetesScheduler Uses

type KubernetesScheduler struct {
    // We use a lock here to avoid races
    // between invoking the mesos callback
    // and the invoking the pod registry interfaces.
    // In particular, changes to podtask.T objects are currently guarded by this lock.
    *sync.RWMutex
    // contains filtered or unexported fields
}

KubernetesScheduler implements: 1: A mesos scheduler. 2: A kubernetes scheduler plugin. 3: A kubernetes pod.Registry.

func New Uses

func New(config Config) *KubernetesScheduler

New creates a new KubernetesScheduler

func (*KubernetesScheduler) Disconnected Uses

func (k *KubernetesScheduler) Disconnected(driver bindings.SchedulerDriver)

Disconnected is called when the scheduler loses connection to the master.

func (*KubernetesScheduler) Error Uses

func (k *KubernetesScheduler) Error(driver bindings.SchedulerDriver, message string)

Error is called when there is an unrecoverable error in the scheduler or scheduler driver. The driver should have been aborted before this is invoked.

func (*KubernetesScheduler) ExecutorLost Uses

func (k *KubernetesScheduler) ExecutorLost(driver bindings.SchedulerDriver, executorId *mesos.ExecutorID, slaveId *mesos.SlaveID, status int)

ExecutorLost is called when some executor is lost.

func (*KubernetesScheduler) FrameworkMessage Uses

func (k *KubernetesScheduler) FrameworkMessage(driver bindings.SchedulerDriver,
    executorId *mesos.ExecutorID, slaveId *mesos.SlaveID, message string)

FrameworkMessage is called when the scheduler receives a message from the executor.

func (*KubernetesScheduler) Init Uses

func (k *KubernetesScheduler) Init(electedMaster proc.Process, pl PluginInterface, mux *http.ServeMux) error

func (*KubernetesScheduler) InstallDebugHandlers Uses

func (k *KubernetesScheduler) InstallDebugHandlers(mux *http.ServeMux)

func (*KubernetesScheduler) NewDefaultPluginConfig Uses

func (k *KubernetesScheduler) NewDefaultPluginConfig(terminate <-chan struct{}, mux *http.ServeMux) *PluginConfig

Create creates a scheduler plugin and all supporting background functions.

func (*KubernetesScheduler) NewPluginConfig Uses

func (k *KubernetesScheduler) NewPluginConfig(terminate <-chan struct{}, mux *http.ServeMux,
    podsWatcher *cache.ListWatch) *PluginConfig

func (*KubernetesScheduler) OfferRescinded Uses

func (k *KubernetesScheduler) OfferRescinded(driver bindings.SchedulerDriver, offerId *mesos.OfferID)

OfferRescinded is called when the resources are recinded from the scheduler.

func (*KubernetesScheduler) Registered Uses

func (k *KubernetesScheduler) Registered(drv bindings.SchedulerDriver, fid *mesos.FrameworkID, mi *mesos.MasterInfo)

Registered is called when the scheduler registered with the master successfully.

func (*KubernetesScheduler) Registration Uses

func (k *KubernetesScheduler) Registration() <-chan struct{}

func (*KubernetesScheduler) Reregistered Uses

func (k *KubernetesScheduler) Reregistered(drv bindings.SchedulerDriver, mi *mesos.MasterInfo)

Reregistered is called when the scheduler re-registered with the master successfully. This happends when the master fails over.

func (*KubernetesScheduler) ResourceOffers Uses

func (k *KubernetesScheduler) ResourceOffers(driver bindings.SchedulerDriver, offers []*mesos.Offer)

ResourceOffers is called when the scheduler receives some offers from the master.

func (*KubernetesScheduler) SlaveLost Uses

func (k *KubernetesScheduler) SlaveLost(driver bindings.SchedulerDriver, slaveId *mesos.SlaveID)

SlaveLost is called when some slave is lost.

func (*KubernetesScheduler) StatusUpdate Uses

func (k *KubernetesScheduler) StatusUpdate(driver bindings.SchedulerDriver, taskStatus *mesos.TaskStatus)

StatusUpdate is called when a status update message is sent to the scheduler.

type PluginConfig Uses

type PluginConfig struct {
    *plugin.Config
    // contains filtered or unexported fields
}

type PluginInterface Uses

type PluginInterface interface {

    // execute the Scheduling plugin, should start a go routine and return immediately
    Run(<-chan struct{})
    // contains filtered or unexported methods
}

func NewPlugin Uses

func NewPlugin(c *PluginConfig) PluginInterface

type Pod Uses

type Pod struct {
    *api.Pod
    // contains filtered or unexported fields
}

wrapper for the k8s pod type so that we can define additional methods on a "pod"

func (*Pod) Breaker Uses

func (p *Pod) Breaker() queue.BreakChan

func (*Pod) Copy Uses

func (p *Pod) Copy() queue.Copyable

implements Copyable

func (*Pod) Deadline Uses

func (dp *Pod) Deadline() (time.Time, bool)

implements Deadlined

func (*Pod) GetDelay Uses

func (dp *Pod) GetDelay() time.Duration

func (*Pod) GetUID Uses

func (p *Pod) GetUID() string

implements Unique

func (*Pod) String Uses

func (p *Pod) String() string

type PodScheduleFunc Uses

type PodScheduleFunc func(r offers.Registry, slaves SlaveIndex, task *podtask.T) (offers.Perishable, error)

PodScheduleFunc implements how to schedule pods among slaves. We can have different implementation for different scheduling policy.

The Schedule function accepts a group of slaves (each contains offers from that slave) and a single pod, which aligns well with the k8s scheduling algorithm. It returns an offerId that is acceptable for the pod, otherwise nil. The caller is responsible for filling in task state w/ relevant offer details.

See the FCFSScheduleFunc for example.

type Reconciler Uses

type Reconciler struct {
    proc.Doer
    Action ReconcilerAction
    // contains filtered or unexported fields
}

func (*Reconciler) RequestExplicit Uses

func (r *Reconciler) RequestExplicit()

func (*Reconciler) RequestImplicit Uses

func (r *Reconciler) RequestImplicit()

func (*Reconciler) Run Uses

func (r *Reconciler) Run(driver bindings.SchedulerDriver)

execute task reconciliation, returns when r.done is closed. intended to run as a goroutine. if reconciliation is requested while another is in progress, the in-progress operation will be cancelled before the new reconciliation operation begins.

type ReconcilerAction Uses

type ReconcilerAction func(driver bindings.SchedulerDriver, cancel <-chan struct{}) <-chan error

type Slave Uses

type Slave struct {
    HostName string
}

type SlaveIndex Uses

type SlaveIndex interface {
    // contains filtered or unexported methods
}

Package scheduler imports 38 packages (graph). Updated 2019-06-25. Refresh now. Tools for package owners.