Documentation ¶
Index ¶
- Constants
- type NoopPlugin
- func (p *NoopPlugin) AckPodEvent(event *scalar.PodEvent)
- func (p *NoopPlugin) KillPod(context context.Context, podID string) error
- func (p *NoopPlugin) LaunchPods(ctx context.Context, pods []*models.LaunchablePod, hostname string) ([]*models.LaunchablePod, error)
- func (p *NoopPlugin) ReconcileHosts() ([]*scalar.HostInfo, error)
- func (p *NoopPlugin) Start() error
- func (p *NoopPlugin) Stop()
- type Plugin
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.
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
Click to show internal directories.
Click to hide internal directories.