plugins

package
v0.0.0-...-d2b1cdf Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoopPlugin

type NoopPlugin struct{}

func (*NoopPlugin) AckPodEvent

func (p *NoopPlugin) AckPodEvent(ctx context.Context, event *scalar.PodEvent)

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

func (*NoopPlugin) KillPod

func (p *NoopPlugin) KillPod(podID string) error

KillPod kills a pod on a host.

func (*NoopPlugin) LaunchPod

func (p *NoopPlugin) LaunchPod(podSpec *pbpod.PodSpec, podID, hostname string) error

LaunchPod launches a pod 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()

	// LaunchPod launches a pod on a host.
	LaunchPod(podSpec *pbpod.PodSpec, podID, hostname string) error

	// KillPod kills a pod on a host.
	KillPod(podID string) error

	// AckPodEvent is only implemented by mesos plugin. For K8s this is a noop.
	AckPodEvent(ctx context.Context, 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