deploy

package
v2.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2016 License: Apache-2.0 Imports: 5 Imported by: 90

Documentation

Overview

Package deploy contains information about all of the deployed instances, and how they are organized across accounts, apps, regions, clusters, and autoscaling groups.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASG

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

ASG identifies an autoscaling group in the deployment

func NewASG

func NewASG(name, region string, instanceIDs []string, cluster *Cluster) *ASG

NewASG creates a new ASG

func (*ASG) AccountName

func (a *ASG) AccountName() string

AccountName returns the name of the AWS account associated with the ASG

func (*ASG) AppName

func (a *ASG) AppName() string

AppName returns the name of the app associated with this ASG

func (*ASG) CloudProvider

func (a *ASG) CloudProvider() string

CloudProvider returns the cloud provider (e.g., "aws")

func (*ASG) ClusterName

func (a *ASG) ClusterName() string

ClusterName returns the name of the cluster associated with the ASG

func (*ASG) DetailName

func (a *ASG) DetailName() string

DetailName returns the name of the detail field associated with the ASG

func (*ASG) Empty

func (a *ASG) Empty() bool

Empty returns true if the ASG does not contain any instances

func (*ASG) Instances

func (a *ASG) Instances() []*Instance

Instances returns a slice of the instances associated with the ASG

func (*ASG) Name

func (a *ASG) Name() string

Name returns the name of the ASG

func (*ASG) RegionName

func (a *ASG) RegionName() string

RegionName returns the name of the region associated with the ASG

func (*ASG) StackName

func (a *ASG) StackName() string

StackName returns the name of the stack

type ASGName

type ASGName string

ASGName is the app-stack-detail-sequence name of an ASG

type Account

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

Account represents the set of clusters associated with an App that reside in one AWS account (e.g., "prod", "test").

func (*Account) AppName

func (a *Account) AppName() string

AppName returns the name of the app associated with this Account

func (*Account) CloudProvider

func (a *Account) CloudProvider() string

CloudProvider returns the cloud provider (e.g., "aws")

func (*Account) Clusters

func (a *Account) Clusters() []*Cluster

Clusters returns a slice of clusters

func (*Account) Name

func (a *Account) Name() string

Name returns the name of the account associated with this account

func (*Account) RegionNames

func (a *Account) RegionNames() []string

RegionNames returns the name of the regions that clusters in this account are running in

func (*Account) StackNames

func (a *Account) StackNames() []string

StackNames returns the names of the stacks associated with this account

type AccountInfo

type AccountInfo struct {
	CloudProvider string
	Clusters      ClusterMap
}

AccountInfo tracks the provider and the clusters

type AccountName

type AccountName string

AccountName is the name of a cloud account

type App

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

App represents an application

func NewApp

func NewApp(name string, data AppMap) *App

NewApp constructs a new App

func (App) Accounts

func (a App) Accounts() []*Account

Accounts returns a slice of accounts

func (*App) EligibleInstanceGroups

func (app *App) EligibleInstanceGroups(cfg chaosmonkey.AppConfig) []grp.InstanceGroup

EligibleInstanceGroups returns a slice of InstanceGroups that represent groups of instances that are eligible for termination.

Note that this code does not check for violations of mininum time between terminations. Chaos Monkey checks that precondition immediately before termination, not when considering groups of eligible instances.

The way instances are divided into group will depend on

  • the grouping configuration for the app (cluster, stack, app)
  • whether regions are independent

The returned InstanceGroups are guaranteed to contain at least one instance each

Preconditions:

  • app is enabled for Chaos Monkey

func (App) Name

func (a App) Name() string

Name returns the name of an app

type AppMap

type AppMap map[AccountName]AccountInfo

AppMap is a map that tracks info about an app

type Cluster

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

Cluster represents what Spinnaker refers to as a "cluster", which contains app-stack-detail. Every ASG is associated with exactly one cluster. Note that clusters can span regions

func (*Cluster) ASGs

func (c *Cluster) ASGs() []*ASG

ASGs returns a slice of ASGs

func (*Cluster) AccountName

func (c *Cluster) AccountName() string

AccountName returns the name of the account associated with this cluster

func (*Cluster) AppName

func (c *Cluster) AppName() string

AppName returns the name of the app associated with this cluster

func (*Cluster) CloudProvider

func (c *Cluster) CloudProvider() string

CloudProvider returns the cloud provider (e.g., "aws")

func (*Cluster) Name

func (c *Cluster) Name() string

Name returns the name of the cluster, convention: app-stack-detail

func (*Cluster) RegionNames

func (c *Cluster) RegionNames() []string

RegionNames returns the name of the region that this cluster runs in

func (*Cluster) StackName

func (c *Cluster) StackName() string

StackName returns the name of the stack, following the app-stack-detail convention

type ClusterMap

type ClusterMap map[ClusterName]map[RegionName]map[ASGName][]InstanceID

ClusterMap maps cluster name to information about instances by region and ASG

type ClusterName

type ClusterName string

ClusterName is the app-stack-detail name of a cluster

type Deployment

type Deployment interface {
	// Apps sends App objects over a channel
	Apps(c chan<- *App, appNames []string)

	// GetApp retrieves a single App
	GetApp(name string) (*App, error)

	// AppNames returns the names of all apps
	AppNames() ([]string, error)
}

Deployment contains information about how apps are deployed

type Instance

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

Instance implements instance.Instance

func (*Instance) ASGName

func (i *Instance) ASGName() string

ASGName returns the name of the ASG associated with the instance

func (*Instance) AccountName

func (i *Instance) AccountName() string

AccountName returns the name of the AWS account associated with the instance

func (*Instance) AppName

func (i *Instance) AppName() string

AppName returns the name of the app associated with this instance

func (*Instance) CloudProvider

func (i *Instance) CloudProvider() string

CloudProvider returns the cloud provider (e.g., "aws")

func (*Instance) ClusterName

func (i *Instance) ClusterName() string

ClusterName returns the name of the cluster associated with the instance

func (*Instance) ID

func (i *Instance) ID() string

ID returns the instance id

func (*Instance) RegionName

func (i *Instance) RegionName() string

RegionName returns the name of the region associated with the instance

func (*Instance) StackName

func (i *Instance) StackName() string

StackName returns the name of the stack associated with the instance

func (*Instance) String

func (i *Instance) String() string

type InstanceID

type InstanceID string

InstanceID is the i-xxxxxx name of an AWS instance or uuid of a container

type RegionName

type RegionName string

RegionName is the name of an AWS region

Jump to

Keyboard shortcuts

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