Documentation ¶
Overview ¶
Package containerprovisioner defines the container provisioner worker. This worker is responsible for provisioning new containers on the underlying machine.
This worker, the same as the computeprovisioner, will retrieve the containers from the database and simply do the provisioning.
Index ¶
- func Manifold(config ManifoldConfig) dependency.Manifold
- func NewContainerSetupAndProvisioner(ctx context.Context, cs *ContainerSetup, ...) (worker.Worker, error)
- type ContainerMachine
- type ContainerMachineGetter
- type ContainerMachineResult
- type ContainerManagerConfigGetter
- type ContainerProvisionerAPI
- type ContainerSetup
- type ContainerSetupAndProvisioner
- type ContainerSetupParams
- type ControllerAPI
- type DistributionGroupFinder
- type GetContainerWatcherFunc
- type MachinesAPI
- type ManifoldConfig
- type Provisioner
- type ToolsFinder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Manifold ¶
func Manifold(config ManifoldConfig) dependency.Manifold
Manifold creates a manifold that runs a container provisioner.
func NewContainerSetupAndProvisioner ¶
func NewContainerSetupAndProvisioner(ctx context.Context, cs *ContainerSetup, getContainerWatcherFunc GetContainerWatcherFunc) (worker.Worker, error)
NewContainerSetupAndProvisioner returns a ContainerSetupAndProvisioner.
Types ¶
type ContainerMachine ¶
type ContainerMachineGetter ¶
type ContainerMachineGetter interface {
Machines(ctx context.Context, tags ...names.MachineTag) ([]ContainerMachineResult, error)
}
type ContainerMachineResult ¶
type ContainerMachineResult struct { Machine ContainerMachine Err error }
type ContainerManagerConfigGetter ¶
type ContainerManagerConfigGetter interface {
ContainerManagerConfig(context.Context, params.ContainerManagerConfigParams) (params.ContainerManagerConfig, error)
}
type ContainerProvisionerAPI ¶
type ContainerProvisionerAPI interface { ContainerManagerConfigGetter broker.APICalls }
ContainerProvisionerAPI describes methods for provisioning a container.
type ContainerSetup ¶
type ContainerSetup struct {
// contains filtered or unexported fields
}
ContainerSetup sets up the machine to be able to create containers and start a suitable provisioner. Work is triggered by the ContainerSetupAndProvisioner.
func NewContainerSetup ¶
func NewContainerSetup(params ContainerSetupParams) *ContainerSetup
NewContainerSetup returns a ContainerSetup to start the container provisioner workers.
type ContainerSetupAndProvisioner ¶
type ContainerSetupAndProvisioner struct {
// contains filtered or unexported fields
}
ContainerSetupAndProvisioner is a worker that waits for a container of type defined in its config to be found for deployment. Then initializes the container system and starts a container provisioner of that type.
func (*ContainerSetupAndProvisioner) Kill ¶
func (w *ContainerSetupAndProvisioner) Kill()
Kill is part of the worker.Worker interface.
func (*ContainerSetupAndProvisioner) Report ¶
func (w *ContainerSetupAndProvisioner) Report() map[string]interface{}
Report provides information for the engine report.
func (*ContainerSetupAndProvisioner) Wait ¶
func (w *ContainerSetupAndProvisioner) Wait() error
Wait is part of the worker.Worker interface.
type ContainerSetupParams ¶
type ContainerSetupParams struct { Logger logger.Logger ContainerType instance.ContainerType MTag names.MachineTag MachineZone broker.AvailabilityZoner Provisioner *apiprovisioner.Client Config agent.Config MachineLock machinelock.Lock CredentialAPI workercommon.CredentialAPI GetNetConfig func(network.ConfigSource) (network.InterfaceInfos, error) }
ContainerSetupParams are used to initialise a container setup worker.
type ControllerAPI ¶
type ControllerAPI interface { ControllerConfig(context.Context) (controller.Config, error) CACert(context.Context) (string, error) ModelUUID(context.Context) (string, error) ModelConfig(context.Context) (*config.Config, error) WatchForModelConfigChanges(context.Context) (watcher.NotifyWatcher, error) APIAddresses(context.Context) ([]string, error) }
ControllerAPI describes API methods for querying a controller.
type DistributionGroupFinder ¶
type DistributionGroupFinder interface {
DistributionGroupByMachineId(context.Context, ...names.MachineTag) ([]apiprovisioner.DistributionGroupResult, error)
}
DistributionGroupFinder provides access to machine distribution groups.
type GetContainerWatcherFunc ¶
type GetContainerWatcherFunc func(context.Context) (watcher.StringsWatcher, error)
type MachinesAPI ¶
type MachinesAPI interface { Machines(context.Context, ...names.MachineTag) ([]apiprovisioner.MachineResult, error) MachinesWithTransientErrors(context.Context) ([]apiprovisioner.MachineStatusResult, error) WatchMachineErrorRetry(context.Context) (watcher.NotifyWatcher, error) WatchModelMachines(context.Context) (watcher.StringsWatcher, error) ProvisioningInfo(_ context.Context, machineTags []names.MachineTag) (params.ProvisioningInfoResults, error) }
MachinesAPI describes API methods required to access machine provisioning info.
type ManifoldConfig ¶
type ManifoldConfig struct { AgentName string APICallerName string Logger logger.Logger MachineLock machinelock.Lock NewCredentialValidatorFacade func(base.APICaller) (workercommon.CredentialAPI, error) ContainerType instance.ContainerType }
ManifoldConfig defines a container provisioner's dependencies, including how to initialise the container system.
func (ManifoldConfig) Validate ¶
func (cfg ManifoldConfig) Validate() error
Validate is called by start to check for bad configuration.
type Provisioner ¶
type Provisioner interface { worker.Worker }
Provisioner represents a running provisioner worker.
func NewContainerProvisioner ¶
func NewContainerProvisioner( containerType instance.ContainerType, controllerAPI ControllerAPI, machinesAPI MachinesAPI, logger logger.Logger, agentConfig agent.Config, broker environs.InstanceBroker, toolsFinder ToolsFinder, distributionGroupFinder DistributionGroupFinder, credentialAPI common.CredentialAPI, ) (Provisioner, error)
NewContainerProvisioner returns a new Provisioner. When new machines are added to the state, it allocates instances from the environment and allocates them to the new machines.
type ToolsFinder ¶
type ToolsFinder interface { // FindTools returns a list of tools matching the specified // version, os, and architecture. If arch is empty, the // implementation is expected to use a well documented default. FindTools(ctx context.Context, version version.Number, os string, arch string) (coretools.List, error) }
ToolsFinder is an interface used for finding tools to run on provisioned instances.