deploy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2016 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultContext = ""

Variables

View Source
var (
	ErrorObjectNotSupported = errors.New("could not add to deployment, object not supported")
	ErrorConflict           = errors.New("name/namespace combination already exists for type")
)

Functions

This section is empty.

Types

type Deployable

type Deployable interface {
	// Deployment creates a new Deployment based on the types current state. Errors are returned if not possible.
	Deployment() (*Deployment, error)
	// Images returns the images required for deployment
	Images() []*image.Image
}

A Deployable can produce a Deployment

type Deployment

type Deployment struct {
	// contains filtered or unexported fields
}

A Deployment is a collection of Kubernetes deployed. Deployment stores a slice of deployable Kubernetes objects. It can be used to create deployments deployments and is how the current state of a deployment is returned.

func (*Deployment) Add

func (d *Deployment) Add(obj KubeObject) error

Add inserts an object into a deployment. The object must be a valid Kubernetes object or it will fail. There can only be a single object of the same name, namespace, and type. Objects are deep-copied into the Deployment.

func (*Deployment) AddDeployment

func (d *Deployment) AddDeployment(deployment Deployment) (err error)

AddDeployment inserts the contents of one Deployment into another.

func (*Deployment) Diff

func (d *Deployment) Diff(other *Deployment) string

Diff returns the difference between the textual representation of two deployments

func (*Deployment) Equal

func (d *Deployment) Equal(other *Deployment) bool

Equal performs a deep equality check between Deployments. Internal ordering is ignored.

func (Deployment) Len

func (d Deployment) Len() int

Len returns the number of objects in a Deployment.

func (Deployment) Objects

func (d Deployment) Objects() (obj []KubeObject)

Objects returns the contents of a Deployment. No ordering guarantees are given.

func (*Deployment) String

func (d *Deployment) String() string

String returns a JSON representation of a Deployment

type KubeCluster

type KubeCluster struct {
	// contains filtered or unexported fields
}

KubeCluster is able to deploy to Kubernetes clusters. This is a very simple implementation with no error recovery.

func NewKubeClusterFromContext

func NewKubeClusterFromContext(name string) (*KubeCluster, error)

NewKubeClusterFromContext creates a KubeCluster using a Kubernetes client with the configuration of the given context. If the context name is empty, the default context will be used.

func (*KubeCluster) Context

func (c *KubeCluster) Context() string

Context returns the kubectl context being used

func (*KubeCluster) Deploy

func (c *KubeCluster) Deploy(dep *Deployment, update, deleteModifiedPods bool) error

Deploy creates/updates the Deployment's objects on the Kubernetes cluster. Currently no error recovery is implemented; if there is an error the deployment process will immediately halt and return the error. If update is not set, will error if objects exist. If deleteModifiedPods is set, pods of modified RCs will be deleted.

type KubeObject

type KubeObject interface {
	meta.ObjectMetaAccessor
	runtime.Object
}

A KubeObject is an alias for Kubernetes objects.

Jump to

Keyboard shortcuts

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