bluegreen

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeployGroup           = "HAPROXY_DEPLOYMENT_GROUP"
	DeployGroupAltPort    = "HAPROXY_DEPLOYMENT_ALT_PORT"
	DeployGroupColour     = "HAPROXY_DEPLOYMENT_COLOUR"
	DeployProxyPort       = "HAPROXY_0_PORT"
	DeployTargetInstances = "HAPROXY_DEPLOYMENT_TARGET_INSTANCES"
	DeployStartedAt       = "HAPROXY_DEPLOYMENT_STARTED_AT"
	ProxyAppId            = "HAPROXY_APP_ID"
	ColourBlue            = "blue"
	ColourGreen           = "green"
)
View Source
const (
	HAProxyStatsQP = "/haproxy?stats;csv"
	HAProxyPidsQP  = "/_haproxy_getpids"
	BackendRE      = `(?i)^(\d+)_(\d+)_(\d+)_(\d+)_(\d+)$`
)

Variables

View Source
var (
	ErrorNoLabels         = errors.New("No labels found. Please define the HAPROXY_DEPLOYMENT_GROUP and HAPROXY_DEPLOYMENT_ALT_PORT label")
	ErrorNoServicePortSet = errors.New("No service port set")
	LabelFormatErr        = "Please define the %s label"
)

Functions

This section is empty.

Types

type BGClient

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

func (*BGClient) DeployBlueGreen

func (c *BGClient) DeployBlueGreen(app *marathon.Application) (*marathon.Application, error)

func (*BGClient) DeployBlueGreenFromFile

func (c *BGClient) DeployBlueGreenFromFile(filename string) (*marathon.Application, error)

type BlueGreen

type BlueGreen interface {

	// Starts a blue green deployment.  If the application exists then the deployment will slowly
	// release the new version, draining connections from the HAProxy balancer during the process
	// {filename} - the file name of the json | yaml application
	// {opts} - blue/green options
	DeployBlueGreenFromFile(filename string) (*marathon.Application, error)

	// Starts a blue green deployment.  If the application exists then the deployment will slowly
	// release the new version, draining connections from the HAProxy balancer during the process
	// {app} - the application to deploy/update
	// {opts} - blue/green options
	DeployBlueGreen(app *marathon.Application) (*marathon.Application, error)
}

func NewBlueGreenClient

func NewBlueGreenClient(marathon marathon.Marathon, opts *BlueGreenOptions) BlueGreen

type BlueGreenOptions

type BlueGreenOptions struct {
	// The max time to wait on HAProxy to drain connections (in seconds)
	ProxyWaitTimeout time.Duration
	// Initial number of app instances to create
	InitialInstances int
	// Delay (in seconds) to wait between each successive deployment step
	StepDelay time.Duration
	// Resume from previous deployment
	Resume bool
	// Marathon-LB stats endpoint - ex: http://host:9090
	LoadBalancer string
	// if true will attempt to wait until the NEW application or group is running
	Wait bool
	// If true an error will be returned on params defined in the configuration file that
	// could not resolve to user input and environment variables
	ErrorOnMissingParams bool
	// Additional environment params - looks at this map for token substitution which takes
	// priority over matching environment variables
	EnvParams map[string]string
	// Do not actually deploy or scale.  Dry run only
	DryRun bool
}

func NewBlueGreenOptions

func NewBlueGreenOptions() *BlueGreenOptions

Jump to

Keyboard shortcuts

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