core

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2016 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AWSMasterAMIs = map[string]string{
	"ap-northeast-1": "ami-907fa690",
	"ap-southeast-1": "ami-b4a79de6",
	"eu-central-1":   "ami-e8635bf5",
	"eu-west-1":      "ami-0fd0ae78",
	"sa-east-1":      "ami-f9f675e4",
	"us-east-1":      "ami-f57b8f9e",
	"us-west-1":      "ami-87b643c3",
	"cn-north-1":     "ami-3abf2203",
	"ap-southeast-2": "ami-1bb9c221",
	"us-west-2":      "ami-33566d03",
}

Functions

func RunCustomDeployment

func RunCustomDeployment(core *Core, component *models.Component) error

Types

type AWSProvider added in v0.8.5

type AWSProvider struct {
	Credentials map[string]string
	// contains filtered or unexported fields
}

func (*AWSProvider) AddPortToEntrypoint added in v0.8.5

func (p *AWSProvider) AddPortToEntrypoint(m *models.Entrypoint, lbPort int64, nodePort int64) error

func (*AWSProvider) CreateEntrypoint added in v0.8.5

func (p *AWSProvider) CreateEntrypoint(m *models.Entrypoint, action *Action) error

func (*AWSProvider) CreateKube added in v0.8.5

func (p *AWSProvider) CreateKube(m *models.Kube, action *Action) error

func (*AWSProvider) CreateNode added in v0.8.5

func (p *AWSProvider) CreateNode(m *models.Node, action *Action) error

func (*AWSProvider) CreateVolume added in v0.8.5

func (p *AWSProvider) CreateVolume(m *models.Volume, action *Action) error

func (*AWSProvider) DeleteEntrypoint added in v0.8.5

func (p *AWSProvider) DeleteEntrypoint(m *models.Entrypoint) error

func (*AWSProvider) DeleteKube added in v0.8.5

func (p *AWSProvider) DeleteKube(m *models.Kube) error

func (*AWSProvider) DeleteNode added in v0.8.5

func (p *AWSProvider) DeleteNode(m *models.Node) error

func (*AWSProvider) DeleteVolume added in v0.8.5

func (p *AWSProvider) DeleteVolume(m *models.Volume) error

func (*AWSProvider) RemovePortFromEntrypoint added in v0.8.5

func (p *AWSProvider) RemovePortFromEntrypoint(m *models.Entrypoint, lbPort int64) error

func (*AWSProvider) ResizeVolume added in v0.8.5

func (p *AWSProvider) ResizeVolume(m *models.Volume, action *Action) error

func (*AWSProvider) ValidateAccount added in v0.8.5

func (p *AWSProvider) ValidateAccount(m *models.CloudAccount) error

func (*AWSProvider) WaitForVolumeAvailable added in v0.8.5

func (p *AWSProvider) WaitForVolumeAvailable(m *models.Volume, action *Action) error

type Action

type Action struct {
	Status *models.ActionStatus
	// contains filtered or unexported fields
}

func (*Action) Async

func (a *Action) Async() error

func (*Action) Now

func (a *Action) Now() error

type Apps

type Apps struct {
	Collection
}

func (*Apps) Create

func (c *Apps) Create(m *models.App) error

func (*Apps) Delete

func (c *Apps) Delete(id *int64, m *models.App) *Action

type CapacityService

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

func (*CapacityService) Perform

func (s *CapacityService) Perform() error

type CloudAccounts

type CloudAccounts struct {
	Collection
}

func (*CloudAccounts) Create

func (c *CloudAccounts) Create(m *models.CloudAccount) error

func (*CloudAccounts) Delete

func (c *CloudAccounts) Delete(id *int64, m *models.CloudAccount) error

type Collection

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

func (*Collection) Create

func (c *Collection) Create(m models.Model) error

func (*Collection) Delete

func (c *Collection) Delete(id *int64, m models.Model) error

func (*Collection) Get

func (c *Collection) Get(id *int64, m models.Model) error

func (*Collection) GetWithIncludes

func (c *Collection) GetWithIncludes(id *int64, m models.Model, includes []string) error

func (*Collection) Update

func (c *Collection) Update(id *int64, oldM models.Model, m models.Model) error

type Components

type Components struct {
	Collection
}

func (*Components) Delete

func (c *Components) Delete(id *int64, m *models.Component) *Action

func (*Components) Deploy

func (c *Components) Deploy(id *int64, m *models.Component) *Action

type Core

type Core struct {
	Settings

	Log *logrus.Logger

	DB *DB

	CloudAccounts    *CloudAccounts
	Kubes            *Kubes
	Apps             *Apps
	Components       *Components
	Releases         *Releases
	Instances        *Instances
	Volumes          *Volumes
	PrivateImageKeys *PrivateImageKeys
	Entrypoints      *Entrypoints
	Nodes            *Nodes

	Actions map[string]*Action
	// contains filtered or unexported fields
}

func (*Core) BaseURL added in v0.8.6

func (c *Core) BaseURL() string

func (*Core) Initialize

func (c *Core) Initialize()

NOTE this used to be core.New(), but due to how we load in values from the cli package, I needed to first actually initialize a Core struct and then configure.

func (*Core) K8S

func (c *Core) K8S(m *models.Kube) guber.Client

func (*Core) NewAPIClient

func (c *Core) NewAPIClient() *client.Client

func (*Core) SSLEnabled added in v0.8.6

func (c *Core) SSLEnabled() bool

func (*Core) SetResourceActionStatus

func (c *Core) SetResourceActionStatus(m models.Model)

type DB

type DB struct {
	*gorm.DB
	// contains filtered or unexported fields
}

func (*DB) Create

func (db *DB) Create(m models.Model) error

func (*DB) Delete

func (db *DB) Delete(m models.Model) error

func (*DB) Find

func (db *DB) Find(out interface{}, where ...interface{}) error

func (*DB) First

func (db *DB) First(out interface{}, where ...interface{}) error

func (*DB) Preload

func (db *DB) Preload(column string, conditions ...interface{}) *DB

func (*DB) Save

func (db *DB) Save(m models.Model) error

func (*DB) Where

func (db *DB) Where(query interface{}, args ...interface{}) *DB

type Entrypoints

type Entrypoints struct {
	Collection
}

func (*Entrypoints) Create

func (c *Entrypoints) Create(m *models.Entrypoint) error

func (*Entrypoints) Delete

func (c *Entrypoints) Delete(id *int64, m *models.Entrypoint) *Action

func (*Entrypoints) RemovePort

func (c *Entrypoints) RemovePort(id *int64, m *models.Entrypoint, elbPort int64) error

func (*Entrypoints) SetPort

func (c *Entrypoints) SetPort(id *int64, m *models.Entrypoint, elbPort int64, instancePort int64) error

type InstanceObserver

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

func (*InstanceObserver) Perform

func (s *InstanceObserver) Perform() error

type Instances

type Instances struct {
	Collection
}

func (*Instances) CreateVolumes

func (c *Instances) CreateVolumes(id *int64, m *models.Instance) error

func (*Instances) Delete

func (c *Instances) Delete(id *int64, m *models.Instance) *Action

func (*Instances) Log

func (c *Instances) Log(m *models.Instance) (string, error)

func (*Instances) Start

func (c *Instances) Start(id *int64, m *models.Instance) *Action

func (*Instances) Stop

func (c *Instances) Stop(id *int64, m *models.Instance) *Action

type KubeScaler

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

func (*KubeScaler) Scale

func (s *KubeScaler) Scale() error

type Kubes

type Kubes struct {
	Collection
}

func (*Kubes) Create

func (c *Kubes) Create(m *models.Kube) error

func (*Kubes) Delete

func (c *Kubes) Delete(id *int64, m *models.Kube) *Action

type NodeObserver

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

func (*NodeObserver) Perform

func (s *NodeObserver) Perform() error

type NodeSize added in v0.8.5

type NodeSize struct {
	Name     string  `json:"name"`
	RAMGIB   float64 `json:"ram_gib"`
	CPUCores float64 `json:"cpu_cores"`
}

type Nodes

type Nodes struct {
	Collection
}

func (*Nodes) Create

func (c *Nodes) Create(m *models.Node) error

func (*Nodes) Delete

func (c *Nodes) Delete(id *int64, m *models.Node) *Action

type PodNotFoundError

type PodNotFoundError struct {
	InstanceID *int64
}

func (*PodNotFoundError) Error

func (err *PodNotFoundError) Error() string

type Port

type Port struct {
	*models.Port
	// contains filtered or unexported fields
}

type PrivateImageKeys

type PrivateImageKeys struct {
	Collection
}

func (*PrivateImageKeys) Create

type Provider added in v0.8.5

type Provider interface {
	ValidateAccount(*models.CloudAccount) error

	CreateKube(*models.Kube, *Action) error
	DeleteKube(*models.Kube) error

	CreateNode(*models.Node, *Action) error
	DeleteNode(*models.Node) error

	CreateVolume(*models.Volume, *Action) error
	WaitForVolumeAvailable(*models.Volume, *Action) error
	ResizeVolume(*models.Volume, *Action) error
	DeleteVolume(*models.Volume) error

	CreateEntrypoint(*models.Entrypoint, *Action) error
	AddPortToEntrypoint(*models.Entrypoint, int64, int64) error
	RemovePortFromEntrypoint(*models.Entrypoint, int64) error
	DeleteEntrypoint(*models.Entrypoint) error
}

type RecurringService

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

func (*RecurringService) Run

func (s *RecurringService) Run()

type Releases

type Releases struct {
	Collection
}

func (*Releases) Create

func (c *Releases) Create(m *models.Release) error

type RepeatedActionError

type RepeatedActionError struct {
	ResourceID string
}

func (*RepeatedActionError) Error

func (err *RepeatedActionError) Error() string

type Service

type Service interface {
	Perform() error
}

type ServiceSet

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

func NewServiceSet

func NewServiceSet(core *Core, component *models.Component, release *models.Release, baseName string, labelSelector map[string]string, portFilter func(*models.Port) bool) (*ServiceSet, error)

type Settings added in v0.8.2

type Settings struct {
	PsqlHost      string `json:"psql_host"`
	PsqlDb        string `json:"psql_db"`
	PsqlUser      string `json:"psql_user"`
	PsqlPass      string `json:"psql_pass"`
	HTTPBasicUser string `json:"http_basic_user"`
	HTTPBasicPass string `json:"http_basic_pass"`
	PublishHost   string `json:"publish_host"`
	HTTPPort      string `json:"http_port"`
	HTTPSPort     string `json:"https_port"`
	SSLCertFile   string `json:"ssl_cert_file"`
	SSLKeyFile    string `json:"ssl_key_file"`
	LogPath       string `json:"log_file"`
	LogLevel      string `json:"log_level"`

	// NOTE these MUST be provided in ascending order by cost in order to
	// correctly provision the smallest size on Kube creation
	//
	// NodeSizes is a map of provider name (ex. "aws") and node sizes
	NodeSizes map[string][]*NodeSize `json:"node_sizes"`
}

type Volumes

type Volumes struct {
	Collection
}

func (*Volumes) Delete

func (c *Volumes) Delete(id *int64, m *models.Volume) *Action

func (*Volumes) Provision

func (c *Volumes) Provision(id *int64, m *models.Volume) *Action

func (*Volumes) Resize

func (c *Volumes) Resize(id *int64, m *models.Volume) *Action

Resize the Volume

func (*Volumes) WaitForAvailable added in v0.8.5

func (c *Volumes) WaitForAvailable(id *int64, m *models.Volume) error

Jump to

Keyboard shortcuts

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