k8s

package
v0.0.0-...-55fbde6 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthTransport

func NewAuthTransport(conf *config.Server) (*http.Transport, error)

NewAuthTransport returns a pointer to an http.Transport for authentication with k8s or returns an error

Types

type Container

type Container struct {
	Name            string        `json:"name"`
	Image           string        `json:"image"`
	Command         []string      `json:"command,omitempty"`
	Args            []string      `json:"args,omitempty"`
	WorkingDir      string        `json:"workingDir,omitempty"`
	Ports           []port        `json:"ports,omitempty"`
	Env             []envVar      `json:"env,omitempty"`
	VolumeMounts    []volumeMount `json:"volumeMounts,omitempty"`
	SecurityContext *secCtx       `json:"securityContext,omitempty"`
	TTY             bool          `json:"tty,omitempty"`
}

Container is a struct reoresenting a k8s container API object

func NewContainer

func NewContainer(maestroVersion string, cmd []string, vols []volumeMount, sec *secCtx) *Container

NewContainer returns a pointer to a Container struct

type Driver

type Driver struct {
	manager.Driver
	Host           string
	MaestroVersion string
	Client         *http.Client
	Mounts         []config.Mount
}

Driver is a struct for the k8s Driver

func New

func New(maestroVersion string, conf *config.Config) *Driver

New returns a pointer to a k8s Driver

func (*Driver) CreateNamespace

func (d *Driver) CreateNamespace(namespace string) error

CreateNamespace creates a maestro k8s namespace if one does not exist

func (*Driver) CreateSvcAccnt

func (d *Driver) CreateSvcAccnt(name string) error

CreateSvcAccnt creates a kubernetes svc accnt

func (Driver) DestroyWorker

func (d Driver) DestroyWorker(project, branch string) error

DestroyWorker will delete a maestro pod

func (Driver) Run

func (d Driver) Run(name, confTarget, hostVolume string, args []string) error

Run will run a maestro pod in kubernetes

type Namespace

type Namespace struct {
	Kind       string     `json:"kind"`
	ApiVersion string     `json:"apiVersion"`
	Metadata   nsMetadata `json:"metadata"`
}

Namespace is a struct for creating k8s Namespaces

type Pod

type Pod struct {
	Kind       string      `json:"kind"`
	ApiVersion string      `json:"apiVersion"`
	Metadata   podMetadata `json:"metadata"`
	Spec       podSpec     `json:"spec"`
}

Pod is a struct for creating k8s pods

type ServiceAccount

type ServiceAccount struct {
	Kind       string     `json:"kind"`
	ApiVersion string     `json:"apiVersion"`
	Metadata   saMetadata `json:"metadata"`
}

ServiceAccount is a struct for creating svc accnts

type Volume

type Volume struct {
	Name                  string                `json:"name"`
	Type                  string                `json:"-"`
	HostPath              *hostPath             `json:"hostPath,omitempty"`
	GCEPersistentDisk     *gcePersistentDisk    `json:"gcePersistentDisk,omitempty"`
	AWSElasticBlockStore  *awsElasticBlockStore `json:"awsElasticBlockStore,omitempty"`
	NFS                   *nfs                  `json:"nfs,omitempty"`
	GlusterFS             *gluster              `json:"glusterfs,omitempty"`
	PersistentVolumeClaim *claim                `json:"persistentVolumeClaim,omitempty"`
	Cinder                *cinder               `json:"cinder,omitempty"`
	Flocker               *flocker              `json:"flocker,omitempty"`
}

Volume is a struct for creating volumes in k8s

func NewVolume

func NewVolume(name, confTarget string, driver *Driver) (*Volume, error)

NewVolume returns a pointer to a volume or an error

func (*Volume) DelegateType

func (v *Volume) DelegateType(confTarget, confTargetPrefix string, volumeConf *config.Mount)

DelegateType picks what type of volume to use

Jump to

Keyboard shortcuts

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