orchestrators

package
v1.0.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2018 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CattleOrchestrator

type CattleOrchestrator struct {
	Handler *handler.Bivac
	Client  *client.RancherClient
}

CattleOrchestrator implements a container orchestrator for Cattle

func NewCattleOrchestrator

func NewCattleOrchestrator(c *handler.Bivac) (o *CattleOrchestrator)

NewCattleOrchestrator creates a Cattle client

func (*CattleOrchestrator) ContainerExec

func (o *CattleOrchestrator) ContainerExec(mountedVolumes *volume.MountedVolumes, command []string) (err error)

ContainerExec executes a command in a container

func (*CattleOrchestrator) DeleteWorker

func (o *CattleOrchestrator) DeleteWorker(container *client.Container)

DeleteWorker deletes a worker

func (*CattleOrchestrator) GetHandler

func (o *CattleOrchestrator) GetHandler() *handler.Bivac

GetHandler returns the Orchestrator's handler

func (*CattleOrchestrator) GetMountedVolumes

func (o *CattleOrchestrator) GetMountedVolumes() (containers []*volume.MountedVolumes, err error)

GetMountedVolumes returns mounted volumes

func (*CattleOrchestrator) GetName

func (*CattleOrchestrator) GetName() string

GetName returns the orchestrator name

func (*CattleOrchestrator) GetVolumes

func (o *CattleOrchestrator) GetVolumes() (volumes []*volume.Volume, err error)

GetVolumes returns the Cattle volumes

func (*CattleOrchestrator) LaunchContainer

func (o *CattleOrchestrator) LaunchContainer(image string, env map[string]string, cmd []string, volumes []*volume.Volume) (state int, stdout string, err error)

LaunchContainer starts a containe using the Cattle orchestrator

type DockerOrchestrator

type DockerOrchestrator struct {
	Handler *handler.Bivac
	Client  *docker.Client
}

DockerOrchestrator implements a container orchestrator for Docker

func NewDockerOrchestrator

func NewDockerOrchestrator(c *handler.Bivac) (o *DockerOrchestrator)

NewDockerOrchestrator creates a Docker client

func (*DockerOrchestrator) ContainerExec

func (o *DockerOrchestrator) ContainerExec(mountedVolumes *volume.MountedVolumes, command []string) (err error)

ContainerExec executes a command in a container

func (*DockerOrchestrator) GetHandler

func (o *DockerOrchestrator) GetHandler() *handler.Bivac

GetHandler returns the Orchestrator's handler

func (*DockerOrchestrator) GetMountedVolumes

func (o *DockerOrchestrator) GetMountedVolumes() (containers []*volume.MountedVolumes, err error)

GetMountedVolumes returns mounted volumes

func (*DockerOrchestrator) GetName

func (*DockerOrchestrator) GetName() string

GetName returns the orchestrator name

func (*DockerOrchestrator) GetVolumes

func (o *DockerOrchestrator) GetVolumes() (volumes []*volume.Volume, err error)

GetVolumes returns the Docker volumes, inspected and filtered

func (*DockerOrchestrator) LaunchContainer

func (o *DockerOrchestrator) LaunchContainer(image string, env map[string]string, cmd []string, volumes []*volume.Volume) (state int, stdout string, err error)

LaunchContainer starts a container using the Docker orchestrator

type KubernetesOrchestrator

type KubernetesOrchestrator struct {
	Handler *handler.Bivac
	Client  *kubernetes.Clientset
}

KubernetesOrchestrator implements a container orchestrator for Kubernetes

func NewKubernetesOrchestrator

func NewKubernetesOrchestrator(c *handler.Bivac) (o *KubernetesOrchestrator)

NewKubernetesOrchestrator creates a Kubernetes client

func (*KubernetesOrchestrator) ContainerExec

func (o *KubernetesOrchestrator) ContainerExec(mountedVolumes *volume.MountedVolumes, command []string) (err error)

ContainerExec executes a command in a container

func (*KubernetesOrchestrator) DeleteWorker

func (o *KubernetesOrchestrator) DeleteWorker(name string)

DeleteWorker deletes a worker

func (*KubernetesOrchestrator) GetHandler

func (o *KubernetesOrchestrator) GetHandler() *handler.Bivac

GetHandler returns the Orchestrator's handler

func (*KubernetesOrchestrator) GetMountedVolumes

func (o *KubernetesOrchestrator) GetMountedVolumes() (containers []*volume.MountedVolumes, err error)

GetMountedVolumes returns mounted volumes

func (*KubernetesOrchestrator) GetName

func (*KubernetesOrchestrator) GetName() string

GetName returns the orchestrator name

func (*KubernetesOrchestrator) GetVolumes

func (o *KubernetesOrchestrator) GetVolumes() (volumes []*volume.Volume, err error)

GetVolumes returns the Kubernetes persistent volume claims, inspected and filtered

func (*KubernetesOrchestrator) LaunchContainer

func (o *KubernetesOrchestrator) LaunchContainer(image string, env map[string]string, cmd []string, volumes []*volume.Volume) (state int, stdout string, err error)

LaunchContainer starts a container using the Kubernetes orchestrator

type Orchestrator

type Orchestrator interface {
	GetName() string
	GetHandler() *handler.Bivac
	GetVolumes() ([]*volume.Volume, error)
	LaunchContainer(image string, env map[string]string, cmd []string, volumes []*volume.Volume) (state int, stdout string, err error)
	GetMountedVolumes() ([]*volume.MountedVolumes, error)
	ContainerExec(mountedVolumes *volume.MountedVolumes, command []string) error
}

Orchestrator implements a container Orchestrator interface

func GetOrchestrator

func GetOrchestrator(c *handler.Bivac) (orch Orchestrator, err error)

GetOrchestrator returns the Orchestrator based on configuration or environment if not defined

Jump to

Keyboard shortcuts

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