deployment

package
v0.22.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Image      string `json:"image"`
	PullPolicy string `json:"imagePullPolicy"`
	Name       string `json:"name"`
}

Container holds information like image, pull policy, name, etc...

type Deployment

type Deployment struct {
	Metadata Metadata `json:"metadata"`
}

Deployment repesentes a kubernetes deployment

func CreateLinuxDeploy

func CreateLinuxDeploy(image, name, namespace, miscOpts string) (*Deployment, error)

CreateLinuxDeploy will create a deployment for a given image with a name in a namespace --overrides='{ "apiVersion": "extensions/v1beta1", "spec":{"template":{"spec": {"nodeSelector":{"beta.kubernetes.io/os":"linux"}}}}}'

func CreateWindowsDeploy

func CreateWindowsDeploy(image, name, namespace string, port int, hostport int) (*Deployment, error)

CreateWindowsDeploy will crete a deployment for a given image with a name in a namespace

func Get

func Get(name, namespace string) (*Deployment, error)

Get returns a deployment from a name and namespace

func RunLinuxDeploy added in v0.13.0

func RunLinuxDeploy(image, name, namespace, command string, replicas int) (*Deployment, error)

RunLinuxDeploy will create a deployment that runs a bash command in a pod --overrides='{ "apiVersion": "extensions/v1beta1", "spec":{"template":{"spec": {"nodeSelector":{"beta.kubernetes.io/os":"linux"}}}}}'

func (*Deployment) CreateDeploymentHPA added in v0.14.0

func (d *Deployment) CreateDeploymentHPA(cpuPercent, min, max int) error

CreateDeploymentHPA applies autoscale characteristics to deployment

func (*Deployment) Delete

func (d *Deployment) Delete() error

Delete will delete a deployment in a given namespace

func (*Deployment) Expose

func (d *Deployment) Expose(svcType string, targetPort, exposedPort int) error

Expose will create a load balancer and expose the deployment on a given port

func (*Deployment) Pods added in v0.8.0

func (d *Deployment) Pods() ([]pod.Pod, error)

Pods will return all pods related to a deployment

func (*Deployment) WaitForReplicas added in v0.20.0

func (d *Deployment) WaitForReplicas(n int, sleep, duration time.Duration) ([]pod.Pod, error)

WaitForReplicas waits for a minimum of n pod replicas

type List

type List struct {
	Deployments []Deployment `json:"items"`
}

List holds a list of deployments returned from kubectl get deploy

type Metadata

type Metadata struct {
	CreatedAt time.Time         `json:"creationTimestamp"`
	Labels    map[string]string `json:"labels"`
	Name      string            `json:"name"`
	Namespace string            `json:"namespace"`
	HasHPA    bool              `json:"hasHPA"`
}

Metadata holds information like labels, name, and namespace

type Spec

type Spec struct {
	Replicas int      `json:"replicas"`
	Template Template `json:"template"`
}

Spec holds information the deployment strategy and number of replicas

type Template

type Template struct {
	TemplateSpec TemplateSpec `json:"spec"`
}

Template is used for fetching the deployment spec -> containers

type TemplateSpec

type TemplateSpec struct {
	Containers    []Container `json:"containers"`
	DNSPolicy     string      `json:"dnsPolicy"`
	RestartPolicy string      `json:"restartPolicy"`
}

TemplateSpec holds the list of containers for a deployment, the dns policy, and restart policy

Jump to

Keyboard shortcuts

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