Documentation ¶
Index ¶
- Variables
- func ImageRepoName(m *common.ContainerBlueprint) string
- func RunCustomDeployment(core *Core, component *ComponentResource) error
- func SetLogLevel(level string)
- type AppCollection
- type AppList
- type AppResource
- type AwsVolume
- type Collection
- type ComponentCollection
- type ComponentList
- type ComponentResource
- func (r *ComponentResource) App() *AppResource
- func (r *ComponentResource) CurrentRelease() (*ReleaseResource, error)
- func (r *ComponentResource) Delete() error
- func (r *ComponentResource) Releases() *ReleaseCollection
- func (r *ComponentResource) Save() error
- func (r *ComponentResource) TargetRelease() (*ReleaseResource, error)
- type Core
- type EntrypointCollection
- type EntrypointList
- type EntrypointResource
- type ExternalPort
- type ImageRepoCollection
- type ImageRepoList
- type ImageRepoResource
- type InstanceCollection
- type InstanceList
- type InstanceResource
- func (r *InstanceResource) App() *AppResource
- func (r *InstanceResource) Component() *ComponentResource
- func (r *InstanceResource) Delete() (err error)
- func (r *InstanceResource) DeleteVolumes() error
- func (r *InstanceResource) IsStarted() bool
- func (r *InstanceResource) IsStopped() bool
- func (r *InstanceResource) Log() (string, error)
- func (r *InstanceResource) Release() *ReleaseResource
- func (r *InstanceResource) Start() error
- func (r *InstanceResource) Stop() error
- func (r *InstanceResource) Volumes() (vols []*AwsVolume)
- type InternalPort
- type OrderedResource
- type ReleaseCollection
- func (c *ReleaseCollection) Create(r *ReleaseResource) (*ReleaseResource, error)
- func (c *ReleaseCollection) Get(id common.ID) (*ReleaseResource, error)
- func (c *ReleaseCollection) List() (*ReleaseList, error)
- func (c *ReleaseCollection) MergeCreate(r *ReleaseResource) (*ReleaseResource, error)
- func (c *ReleaseCollection) New() *ReleaseResource
- type ReleaseList
- type ReleaseResource
- func (newR *ReleaseResource) AddNewPorts(oldR *ReleaseResource) error
- func (r *ReleaseResource) App() *AppResource
- func (r *ReleaseResource) Component() *ComponentResource
- func (r *ReleaseResource) Delete() error
- func (r *ReleaseResource) ExternalPorts() (ports []*ExternalPort)
- func (r *ReleaseResource) ExternalServiceName() string
- func (r *ReleaseResource) ImagePullSecrets() (pullSecrets []*guber.ImagePullSecret, err error)
- func (r *ReleaseResource) Instances() *InstanceCollection
- func (r *ReleaseResource) InternalPorts() (ports []*InternalPort)
- func (r *ReleaseResource) InternalServiceName() string
- func (r *ReleaseResource) IsStarted() bool
- func (r *ReleaseResource) IsStopped() bool
- func (r *ReleaseResource) Provision() error
- func (newR *ReleaseResource) RemoveOldPorts(oldR *ReleaseResource) error
- func (r *ReleaseResource) Save() error
- type Resource
- type TaskCollection
- func (c *TaskCollection) Create(r *TaskResource) (*TaskResource, error)
- func (c *TaskCollection) Get(id common.ID) (*TaskResource, error)
- func (c *TaskCollection) List() (*TaskList, error)
- func (c *TaskCollection) New() *TaskResource
- func (c *TaskCollection) Start(t common.TaskType, msg interface{}) (*TaskResource, error)
- type TaskList
- type TaskResource
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ImageRepoName ¶
func ImageRepoName(m *common.ContainerBlueprint) string
func RunCustomDeployment ¶ added in v0.4.0
func RunCustomDeployment(core *Core, component *ComponentResource) error
func SetLogLevel ¶ added in v0.4.1
func SetLogLevel(level string)
TODO inconsistent with method in Guber and client/
Types ¶
type AppCollection ¶
type AppCollection struct {
// contains filtered or unexported fields
}
func (*AppCollection) Create ¶
func (c *AppCollection) Create(r *AppResource) (*AppResource, error)
Create takes an App and creates it in etcd. It also creates a Kubernetes Namespace with the name of the App.
func (*AppCollection) Get ¶
func (c *AppCollection) Get(name common.ID) (*AppResource, error)
Get takes a name and returns an AppResource if it exists.
func (*AppCollection) List ¶
func (c *AppCollection) List() (*AppList, error)
List returns an AppList.
func (*AppCollection) New ¶
func (c *AppCollection) New() *AppResource
New initializes an App with a pointer to the Collection.
type AppList ¶
type AppList struct {
Items []*AppResource `json:"items"`
}
NOTE this does not inherit from common like model does; all we need is a List object, internally, that has a slice of our composed model above.
type AppResource ¶
func (*AppResource) Components ¶
func (r *AppResource) Components() *ComponentCollection
Components returns a ComponentCollection with a pointer to the AppResource.
func (*AppResource) Delete ¶
func (r *AppResource) Delete() error
Delete cascades deletes to all Components, deletes the Kube Namespace, and deletes the App in etcd.
func (*AppResource) Save ¶ added in v0.4.0
func (r *AppResource) Save() error
Save saves the App in etcd through an update.
type AwsVolume ¶
type AwsVolume struct { Blueprint *common.VolumeBlueprint Instance *InstanceResource // contains filtered or unexported fields }
type Collection ¶
type Collection interface {
// contains filtered or unexported methods
}
Collection is an interface for defining behavior of a collection of Resources.
type ComponentCollection ¶
type ComponentCollection struct { App *AppResource // contains filtered or unexported fields }
func (*ComponentCollection) Create ¶
func (c *ComponentCollection) Create(r *ComponentResource) (*ComponentResource, error)
Create takes an Component and creates it in etcd.
func (*ComponentCollection) Get ¶
func (c *ComponentCollection) Get(name common.ID) (*ComponentResource, error)
Get takes a name and returns an ComponentResource if it exists.
func (*ComponentCollection) List ¶
func (c *ComponentCollection) List() (*ComponentList, error)
List returns an ComponentList.
func (*ComponentCollection) New ¶
func (c *ComponentCollection) New() *ComponentResource
New initializes an Component with a pointer to the Collection.
type ComponentList ¶
type ComponentList struct {
Items []*ComponentResource `json:"items"`
}
type ComponentResource ¶
func (*ComponentResource) App ¶
func (r *ComponentResource) App() *AppResource
func (*ComponentResource) CurrentRelease ¶
func (r *ComponentResource) CurrentRelease() (*ReleaseResource, error)
func (*ComponentResource) Delete ¶
func (r *ComponentResource) Delete() error
Delete cascades delete calls to current and target releases, and deletes the Component in etcd.
TODO this should somehow stop any ongoing tasks related to the Component.
func (*ComponentResource) Releases ¶
func (r *ComponentResource) Releases() *ReleaseCollection
func (*ComponentResource) Save ¶
func (r *ComponentResource) Save() error
Save saves the Component in etcd through an update.
func (*ComponentResource) TargetRelease ¶
func (r *ComponentResource) TargetRelease() (*ReleaseResource, error)
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
func (*Core) Apps ¶
func (c *Core) Apps() *AppCollection
Top-level resources ==============================================================================
func (*Core) Entrypoints ¶
func (c *Core) Entrypoints() *EntrypointCollection
func (*Core) ImageRepos ¶
func (c *Core) ImageRepos() *ImageRepoCollection
func (*Core) Tasks ¶
func (c *Core) Tasks() *TaskCollection
type EntrypointCollection ¶
type EntrypointCollection struct {
// contains filtered or unexported fields
}
func (*EntrypointCollection) Create ¶
func (c *EntrypointCollection) Create(r *EntrypointResource) (*EntrypointResource, error)
Create takes an Entrypoint and creates it in etcd. It also creates a Kubernetes Namespace with the name of the Entrypoint.
func (*EntrypointCollection) Get ¶
func (c *EntrypointCollection) Get(domain common.ID) (*EntrypointResource, error)
Get takes a name and returns an EntrypointResource if it exists.
func (*EntrypointCollection) List ¶
func (c *EntrypointCollection) List() (*EntrypointList, error)
List returns an EntrypointList.
func (*EntrypointCollection) New ¶
func (c *EntrypointCollection) New() *EntrypointResource
New initializes an Entrypoint with a pointer to the Collection.
type EntrypointList ¶
type EntrypointList struct {
Items []*EntrypointResource `json:"items"`
}
NOTE this does not inherit from common like model does; all we need is a List object, internally, that has a slice of our composed model above.
type EntrypointResource ¶
type EntrypointResource struct { *common.Entrypoint // contains filtered or unexported fields }
func (*EntrypointResource) AddPort ¶
func (r *EntrypointResource) AddPort(elbPort int, instancePort int) error
AddPort creates a listener on the ELB.
func (*EntrypointResource) Delete ¶
func (r *EntrypointResource) Delete() error
Delete cascades deletes to all Components, deletes the Kube Namespace, and deletes the Entrypoint in etcd.
func (*EntrypointResource) RemovePort ¶
func (r *EntrypointResource) RemovePort(elbPort int) error
RemovePort removes a listener from the ELB.
func (*EntrypointResource) Save ¶
func (r *EntrypointResource) Save() error
Save saves the Entrypoint in etcd through an update.
type ExternalPort ¶ added in v0.3.2
type ExternalPort struct {
// contains filtered or unexported fields
}
type ImageRepoCollection ¶
type ImageRepoCollection struct {
// contains filtered or unexported fields
}
func (*ImageRepoCollection) Create ¶
func (c *ImageRepoCollection) Create(r *ImageRepoResource) (*ImageRepoResource, error)
Create takes an ImageRepo and creates it in etcd. It also creates a Kubernetes Namespace with the name of the ImageRepo.
func (*ImageRepoCollection) Get ¶
func (c *ImageRepoCollection) Get(name common.ID) (*ImageRepoResource, error)
Get takes a name and returns an ImageRepoResource if it exists.
func (*ImageRepoCollection) List ¶
func (c *ImageRepoCollection) List() (*ImageRepoList, error)
List returns an ImageRepoList.
func (*ImageRepoCollection) New ¶
func (c *ImageRepoCollection) New() *ImageRepoResource
New initializes an ImageRepo with a pointer to the Collection.
type ImageRepoList ¶
type ImageRepoList struct {
Items []*ImageRepoResource `json:"items"`
}
NOTE this does not inherit from common like model does; all we need is a List object, internally, that has a slice of our composed model above.
type ImageRepoResource ¶
func (*ImageRepoResource) Delete ¶
func (r *ImageRepoResource) Delete() error
Delete deletes the ImageRepo in etcd.
type InstanceCollection ¶
type InstanceCollection struct { Release *ReleaseResource // contains filtered or unexported fields }
func (*InstanceCollection) Get ¶
func (c *InstanceCollection) Get(id common.ID) (*InstanceResource, error)
Get takes an id and returns an InstanceResource if it exists.
func (*InstanceCollection) List ¶
func (c *InstanceCollection) List() *InstanceList
List returns an InstanceList.
func (*InstanceCollection) New ¶
func (c *InstanceCollection) New(id common.ID) *InstanceResource
New initializes an Instance with a pointer to the Collection.
type InstanceList ¶
type InstanceList struct {
Items []*InstanceResource `json:"items"`
}
type InstanceResource ¶
func (*InstanceResource) App ¶
func (r *InstanceResource) App() *AppResource
func (*InstanceResource) Component ¶
func (r *InstanceResource) Component() *ComponentResource
func (*InstanceResource) Delete ¶
func (r *InstanceResource) Delete() (err error)
Delete tears down the instance
func (*InstanceResource) DeleteVolumes ¶
func (r *InstanceResource) DeleteVolumes() error
exposed for use in deploy_component.go
func (*InstanceResource) IsStarted ¶
func (r *InstanceResource) IsStarted() bool
func (*InstanceResource) IsStopped ¶
func (r *InstanceResource) IsStopped() bool
func (*InstanceResource) Log ¶ added in v0.4.0
func (r *InstanceResource) Log() (string, error)
func (*InstanceResource) Release ¶
func (r *InstanceResource) Release() *ReleaseResource
func (*InstanceResource) Start ¶
func (r *InstanceResource) Start() error
The following 2 are only diff from Provision() and Delete() in that they do not delete the create or delete the volumes.
func (*InstanceResource) Stop ¶
func (r *InstanceResource) Stop() error
func (*InstanceResource) Volumes ¶
func (r *InstanceResource) Volumes() (vols []*AwsVolume)
type InternalPort ¶ added in v0.3.2
type InternalPort struct {
// contains filtered or unexported fields
}
type OrderedResource ¶
type OrderedResource interface {
// contains filtered or unexported methods
}
OrderedResource is similar to Resource, but provides a setID() method to set an auto-generated ID from etcd on the Resource.
type ReleaseCollection ¶
type ReleaseCollection struct { Component *ComponentResource // contains filtered or unexported fields }
func (*ReleaseCollection) Create ¶
func (c *ReleaseCollection) Create(r *ReleaseResource) (*ReleaseResource, error)
Create takes an Release and creates it in etcd.
func (*ReleaseCollection) Get ¶
func (c *ReleaseCollection) Get(id common.ID) (*ReleaseResource, error)
Get takes an id and returns an ReleaseResource if it exists.
func (*ReleaseCollection) List ¶
func (c *ReleaseCollection) List() (*ReleaseList, error)
List returns an ReleaseList.
func (*ReleaseCollection) MergeCreate ¶ added in v0.4.2
func (c *ReleaseCollection) MergeCreate(r *ReleaseResource) (*ReleaseResource, error)
MergeCreate creates a Release by taking a new Release and merging it with the Component's current Release.
func (*ReleaseCollection) New ¶
func (c *ReleaseCollection) New() *ReleaseResource
New initializes an Release with a pointer to the Collection.
type ReleaseList ¶
type ReleaseList struct {
Items []*ReleaseResource `json:"items"`
}
type ReleaseResource ¶
type ReleaseResource struct { *common.Release // TODO these are shared between releases, it's kinda funky right now ExternalService *guber.Service `json:"-"` InternalService *guber.Service `json:"-"` // contains filtered or unexported fields }
func (*ReleaseResource) AddNewPorts ¶ added in v0.3.2
func (newR *ReleaseResource) AddNewPorts(oldR *ReleaseResource) error
AddNewPorts adds any new ports defined in containers to the existing Services. This is used as a part of the deployment process, and is used in conjunction with RemoveOldPorts. We use the config returned from the services themselves, as opposed to just updating the config, because auto-assigned ports need to be preserved.
func (*ReleaseResource) App ¶
func (r *ReleaseResource) App() *AppResource
func (*ReleaseResource) Component ¶
func (r *ReleaseResource) Component() *ComponentResource
func (*ReleaseResource) Delete ¶
func (r *ReleaseResource) Delete() error
Delete removes all assets (volumes, pods, etc.) and deletes the Release in etcd.
func (*ReleaseResource) ExternalPorts ¶ added in v0.3.2
func (r *ReleaseResource) ExternalPorts() (ports []*ExternalPort)
func (*ReleaseResource) ExternalServiceName ¶ added in v0.3.2
func (r *ReleaseResource) ExternalServiceName() string
func (*ReleaseResource) ImagePullSecrets ¶
func (r *ReleaseResource) ImagePullSecrets() (pullSecrets []*guber.ImagePullSecret, err error)
TODO naming inconsistencies for kube definitions of resources ImagePullSecrets returns repo names defined for Kube pods
func (*ReleaseResource) Instances ¶
func (r *ReleaseResource) Instances() *InstanceCollection
func (*ReleaseResource) InternalPorts ¶ added in v0.3.2
func (r *ReleaseResource) InternalPorts() (ports []*InternalPort)
func (*ReleaseResource) InternalServiceName ¶ added in v0.3.2
func (r *ReleaseResource) InternalServiceName() string
func (*ReleaseResource) IsStarted ¶
func (r *ReleaseResource) IsStarted() bool
func (*ReleaseResource) IsStopped ¶
func (r *ReleaseResource) IsStopped() bool
func (*ReleaseResource) Provision ¶
func (r *ReleaseResource) Provision() error
Provision creates needed assets for all instances. It does not actually start instances -- that is handled by deploy.go.
func (*ReleaseResource) RemoveOldPorts ¶ added in v0.3.2
func (newR *ReleaseResource) RemoveOldPorts(oldR *ReleaseResource) error
func (*ReleaseResource) Save ¶ added in v0.3.1
func (r *ReleaseResource) Save() error
Save saves the Release in etcd through an update.
type Resource ¶
type Resource interface { }
Resource is an interface used mainly for generalized marshalling purposes for resource common.
type TaskCollection ¶
type TaskCollection struct {
// contains filtered or unexported fields
}
func (*TaskCollection) Create ¶
func (c *TaskCollection) Create(r *TaskResource) (*TaskResource, error)
Create takes an Task and creates it in etcd. It also creates a Kubernetes Namespace with the name of the Task.
func (*TaskCollection) Get ¶
func (c *TaskCollection) Get(id common.ID) (*TaskResource, error)
Get takes a name and returns an TaskResource if it exists.
func (*TaskCollection) List ¶
func (c *TaskCollection) List() (*TaskList, error)
List returns an TaskList.
func (*TaskCollection) New ¶
func (c *TaskCollection) New() *TaskResource
New initializes an Task with a pointer to the Collection.
func (*TaskCollection) Start ¶
func (c *TaskCollection) Start(t common.TaskType, msg interface{}) (*TaskResource, error)
NOTE kinda like a New().Save()
type TaskList ¶
type TaskList struct {
Items []*TaskResource `json:"items"`
}
NOTE this does not inherit from common like model does; all we need is a List object, internally, that has a slice of our composed model above.
type TaskResource ¶
func (*TaskResource) Claim ¶
func (r *TaskResource) Claim() error
Claim updates the Task status to "RUNNING" and returns nil. compareAndSwap is used to prevent a race condition and ensure only one worker performs the task.
func (*TaskResource) Delete ¶
func (r *TaskResource) Delete() error
Delete deletes the Task in etcd.
func (*TaskResource) IsQueued ¶
func (r *TaskResource) IsQueued() bool
func (*TaskResource) RecordError ¶
func (r *TaskResource) RecordError(err error) error
func (*TaskResource) Save ¶
func (r *TaskResource) Save() error
Save saves the Task in etcd through an update.
func (*TaskResource) TypeName ¶ added in v0.3.0
func (r *TaskResource) TypeName() string