plugins

package
v0.0.0-...-a69e935 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 4 Imported by: 8

Documentation

Index

Constants

View Source
const EventChanSize = 1000

Variables

This section is empty.

Functions

This section is empty.

Types

type NoopPlugin

type NoopPlugin struct{}

func (*NoopPlugin) AckPodEvent

func (p *NoopPlugin) AckPodEvent(event *scalar.PodEvent)

AckPodEvent is only implemented by mesos plugin. For K8s this is a noop.

func (*NoopPlugin) KillPod

func (p *NoopPlugin) KillPod(context context.Context, podID string) error

KillPod kills a pod on a host.

func (*NoopPlugin) LaunchPods

func (p *NoopPlugin) LaunchPods(
	ctx context.Context,
	pods []*models.LaunchablePod,
	hostname string,
) ([]*models.LaunchablePod, error)

LaunchPods launch a list of pods on a host.

func (*NoopPlugin) ReconcileHosts

func (p *NoopPlugin) ReconcileHosts() ([]*scalar.HostInfo, error)

ReconcileHosts will return the current state of hosts in the cluster.

func (*NoopPlugin) Start

func (p *NoopPlugin) Start() error

Start the plugin.

func (*NoopPlugin) Stop

func (p *NoopPlugin) Stop()

Stop the plugin.

type Plugin

type Plugin interface {
	// Start the plugin.
	Start() error

	// Stop the plugin.
	Stop()

	// LaunchPods launch a list of pods on a host.
	LaunchPods(ctx context.Context, pods []*models.LaunchablePod, hostname string) (launched []*models.LaunchablePod, _ error)

	// KillPod kills a pod on a host.
	KillPod(ctx context.Context, podID string) error

	// AckPodEvent is only implemented by mesos plugin. For K8s this is a noop.
	AckPodEvent(event *scalar.PodEvent)

	// ReconcileHosts will return the current state of hosts in the cluster.
	ReconcileHosts() ([]*scalar.HostInfo, error)
}

Plugin interface defines the Northbound API which would be implemented for different underlying cluster management systems.

func NewK8sPlugin

func NewK8sPlugin(
	configPath string,
	podEventsCh chan<- *scalar.PodEvent,
	hostEventCh chan<- *scalar.HostEvent,
) (Plugin, error)

NewK8sPlugin returns a new instance of k8s plugin.

func NewNoopPlugin

func NewNoopPlugin() Plugin

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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