deployment

package
v0.41.3 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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='{ "spec":{"template":{"spec": {"nodeSelector":{"beta.kubernetes.io/os":"linux"}}}}}'

func CreateLinuxDeployDeleteIfExists added in v0.36.0

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

CreateLinuxDeployDeleteIfExists will create a deployment, deleting any pre-existing deployment with the same name

func CreateLinuxDeployIfNotExist

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

CreateLinuxDeployIfNotExist first checks if a deployment already exists, and return it if so If not, we call CreateLinuxDeploy

func CreateWindowsDeploy

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

CreateWindowsDeploy will create a deployment for a given image with a name in a namespace and create a service mapping a hostPort

func CreateWindowsDeployDeleteIfExist added in v0.36.0

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

CreateWindowsDeployDeleteIfExist first checks if a deployment already exists according to a naming pattern If a pre-existing deployment is found matching that pattern, it is deleted

func CreateWindowsDeployWithHostport added in v0.39.0

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

CreateWindowsDeployWithHostport will create a deployment for a given image with a name in a namespace and create a service mapping a hostPort

func CreateWindowsDeployWithHostportDeleteIfExist added in v0.39.0

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

CreateWindowsDeployWithHostportDeleteIfExist first checks if a deployment already exists according to a naming pattern If a pre-existing deployment is found matching that pattern, it is deleted

func CreateWindowsDeployWithHostportIfNotExist added in v0.39.0

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

CreateWindowsDeployWithHostportIfNotExist first checks if a deployment already exists, and return it if so If not, we call CreateWindowsDeploy

func Get

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

Get returns a deployment from a name and namespace

func GetAllByPrefix added in v0.36.0

func GetAllByPrefix(prefix, namespace string) ([]Deployment, error)

GetAllByPrefix will return all pods in a given namespace that match a prefix

func GetWithRetry added in v0.41.0

func GetWithRetry(name, namespace string, sleep, timeout time.Duration) (*Deployment, error)

GetWithRetry gets a deployment, allowing for retries

func RunLinuxDeploy

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=' "spec":{"template":{"spec": {"nodeSelector":{"beta.kubernetes.io/os":"linux"}}}}}'

func RunLinuxDeployDeleteIfExists added in v0.36.0

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

RunLinuxDeployDeleteIfExists will create a deployment that runs a bash command in a pod, deleting any pre-existing deployment with the same name

func (*Deployment) CreateDeploymentHPA

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

CreateDeploymentHPA applies autoscale characteristics to deployment

func (*Deployment) CreateDeploymentHPADeleteIfExist added in v0.36.0

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

CreateDeploymentHPADeleteIfExist applies autoscale characteristics to deployment, deleting any pre-existing HPA resource first

func (*Deployment) Delete

func (d *Deployment) Delete(retries int) error

Delete will delete a deployment in a given namespace

func (*Deployment) Describe added in v0.41.0

func (d *Deployment) Describe() error

Describe will describe a deployment resource

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) ExposeDeleteIfExist added in v0.36.0

func (d *Deployment) ExposeDeleteIfExist(pattern, namespace, svcType string, targetPort, exposedPort int) error

ExposeDeleteIfExist will create a load balancer and expose the deployment on a given port If a service matching the passed in pattern already exists, we'll delete it first

func (*Deployment) ExposeIfNotExist added in v0.36.0

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

ExposeIfNotExist will create a load balancer and expose the deployment on a given port if the associated service doesn't already exist

func (*Deployment) Pods

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

Pods will return all pods related to a deployment

func (*Deployment) ScaleDeployment

func (d *Deployment) ScaleDeployment(n int) error

ScaleDeployment scales a deployment to n instancees

func (*Deployment) WaitForReplicas

func (d *Deployment) WaitForReplicas(min, max int, sleep, timeout time.Duration) ([]pod.Pod, error)

WaitForReplicas waits for a pod replica count between min and max

type GetResult added in v0.41.0

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

GetResult is a return struct for GetAsync

func GetAsync added in v0.41.0

func GetAsync(name, namespace string) GetResult

GetAsync wraps Get with a struct response for goroutine + channel usage

type List

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

List holds a list of deployments returned from kubectl get deploy

func GetAll added in v0.36.0

func GetAll(namespace string) (*List, error)

GetAll will return all deployments in a given namespace

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