executor

package
v1.3.0-alpha.3....-c20dcfc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2016 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package executor includes a mesos executor, which contains a kubelet as its member to manage containers.

Index

Constants

View Source
const (
	PodEventBound podEventType = iota
	PodEventUpdated
	PodEventDeleted
	PodEventIncompatibleUpdate
)

Variables

This section is empty.

Functions

func IsUnsupportedUpdate

func IsUnsupportedUpdate(err error) bool

Types

type Config

type Config struct {
	APIClient         *clientset.Clientset
	Docker            dockertools.DockerInterface
	ShutdownAlert     func()
	SuicideTimeout    time.Duration
	KubeletFinished   <-chan struct{} // signals that kubelet Run() died
	ExitFunc          func(int)
	LaunchGracePeriod time.Duration
	NodeInfos         chan<- NodeInfo
	Registry          Registry
	Options           []Option // functional options
}

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

KubernetesExecutor is an mesos executor that runs pods in a minion machine.

func New

func New(config Config) *Executor

New creates a new kubernetes executor.

func (*Executor) Disconnected

func (k *Executor) Disconnected(driver bindings.ExecutorDriver)

Disconnected is called when the executor is disconnected from the slave.

func (*Executor) Done

func (k *Executor) Done() <-chan struct{}

Done returns a chan that closes when the executor is shutting down

func (*Executor) Error

func (k *Executor) Error(driver bindings.ExecutorDriver, message string)

Error is called when some error happens.

func (*Executor) FrameworkMessage

func (k *Executor) FrameworkMessage(driver bindings.ExecutorDriver, message string)

FrameworkMessage is called when the framework sends some message to the executor

func (*Executor) Init

func (k *Executor) Init(driver bindings.ExecutorDriver)

func (*Executor) KillTask

func (k *Executor) KillTask(driver bindings.ExecutorDriver, taskId *mesos.TaskID)

KillTask is called when the executor receives a request to kill a task.

func (*Executor) LaunchTask

func (k *Executor) LaunchTask(driver bindings.ExecutorDriver, taskInfo *mesos.TaskInfo)

LaunchTask is called when the executor receives a request to launch a task. The happens when the k8sm scheduler has decided to schedule the pod (which corresponds to a Mesos Task) onto the node where this executor is running, but the binding is not recorded in the Kubernetes store yet. This function is invoked to tell the executor to record the binding in the Kubernetes store and start the pod via the Kubelet.

func (*Executor) Registered

func (k *Executor) Registered(
	driver bindings.ExecutorDriver,
	executorInfo *mesos.ExecutorInfo,
	frameworkInfo *mesos.FrameworkInfo,
	slaveInfo *mesos.SlaveInfo,
)

Registered is called when the executor is successfully registered with the slave.

func (*Executor) Reregistered

func (k *Executor) Reregistered(driver bindings.ExecutorDriver, slaveInfo *mesos.SlaveInfo)

Reregistered is called when the executor is successfully re-registered with the slave. This can happen when the slave fails over.

func (*Executor) Shutdown

func (k *Executor) Shutdown(driver bindings.ExecutorDriver)

Shutdown is called when the executor receives a shutdown request.

type NodeInfo

type NodeInfo struct {
	Cores int
	Mem   uint64 // in bytes
}

type Option

type Option func(*Executor)

Option is a functional option type for Executor

func StaticPods

func StaticPods(configPath string, f podutil.Filters) Option

StaticPods creates a static pods Option for an Executor

type PodEvent

type PodEvent struct {
	// contains filtered or unexported fields
}

func (*PodEvent) FormatShort

func (rp *PodEvent) FormatShort() string

func (*PodEvent) Pod

func (rp *PodEvent) Pod() *api.Pod

func (*PodEvent) Task

func (rp *PodEvent) Task() string

type Registry

type Registry interface {
	// Update modifies the registry's iternal representation of the pod; it may also
	// modify the pod argument itself. An update may fail because either a pod isn't
	// labeled with a task ID, the task ID is unknown, or the nature of the update may
	// be incompatible with what's supported in kubernetes-mesos.
	Update(pod *api.Pod) (*PodEvent, error)

	// Remove the task from this registry, returns an error if the taskID is unknown.
	Remove(taskID string) error
	// contains filtered or unexported methods
}

Registry is a state store for pod task metadata. Clients are expected to watch() the event stream to observe changes over time.

func NewRegistry

func NewRegistry(client *clientset.Clientset) Registry

Directories

Path Synopsis
Package config contains executor configuration constants.
Package config contains executor configuration constants.
Package messages exposes executor event/message names as constants.
Package messages exposes executor event/message names as constants.
Package service contains the cmd/k8sm-executor glue code.
Package service contains the cmd/k8sm-executor glue code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL