Documentation
¶
Overview ¶
Package swarm is the Swarm orchestrator: it applies a compose project to a swarm as services, the way docker stack deploy does, and waits until they converged.
Index ¶
- Constants
- func New(ctx context.Context) (installer.Orchestrator, error)
- type Client
- func (swarmClient *Client) ConfigCreate(ctx context.Context, spec *swarm.ConfigSpec) (string, error)
- func (swarmClient *Client) ConfigDelete(ctx context.Context, config *swarm.Config) error
- func (swarmClient *Client) ConfigFind(ctx context.Context, name string) (*swarm.Config, error)
- func (swarmClient *Client) ConfigList(ctx context.Context, filters client.Filters) ([]swarm.Config, error)
- func (swarmClient *Client) ConfigUpdate(ctx context.Context, existing *swarm.Config, spec *swarm.ConfigSpec) error
- func (swarmClient *Client) SecretCreate(ctx context.Context, spec *swarm.SecretSpec) (string, error)
- func (swarmClient *Client) SecretDelete(ctx context.Context, secret *swarm.Secret) error
- func (swarmClient *Client) SecretFind(ctx context.Context, name string) (*swarm.Secret, error)
- func (swarmClient *Client) SecretList(ctx context.Context, filters client.Filters) ([]swarm.Secret, error)
- func (swarmClient *Client) SecretUpdate(ctx context.Context, existing *swarm.Secret, spec *swarm.SecretSpec) error
- func (swarmClient *Client) ServiceCreate(ctx context.Context, spec *swarm.ServiceSpec, registryAuth string) (string, error)
- func (swarmClient *Client) ServiceDelete(ctx context.Context, service *swarm.Service) error
- func (swarmClient *Client) ServiceFind(ctx context.Context, name string) (*swarm.Service, error)
- func (swarmClient *Client) ServiceList(ctx context.Context, filters client.Filters) ([]swarm.Service, error)
- func (swarmClient *Client) ServiceUpdate(ctx context.Context, existing *swarm.Service, spec *swarm.ServiceSpec, ...) error
- func (swarmClient *Client) TaskList(ctx context.Context, filters client.Filters) ([]swarm.Task, error)
- type Orchestrator
- func (orchestrator *Orchestrator) Close() error
- func (orchestrator *Orchestrator) Install(ctx context.Context, project *installer.Project, opts installer.InstallOptions) error
- func (orchestrator *Orchestrator) Name() string
- func (orchestrator *Orchestrator) Uninstall(ctx context.Context, project *installer.Project, ...) error
- func (orchestrator *Orchestrator) Validate(project *installer.Project) error
Constants ¶
const Name = "swarm"
Name is the value of the nemo-orchestrator parameter that selects Swarm.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
Client is the Engine client of the Swarm orchestrator: the one every Docker has, and what only a swarm has, services, tasks, configs and secrets, one file per kind.
func (*Client) ConfigCreate ¶
func (*Client) ConfigDelete ¶
ConfigDelete removes the config. The error tells, with docker.IsInUse, that a service still uses it.
func (*Client) ConfigFind ¶
ConfigFind returns the config of that exact name, or nil.
func (*Client) ConfigList ¶
func (*Client) ConfigUpdate ¶
func (swarmClient *Client) ConfigUpdate(ctx context.Context, existing *swarm.Config, spec *swarm.ConfigSpec) error
ConfigUpdate replaces the labels of an existing config: Swarm changes nothing else of a config, its data least of all.
func (*Client) SecretCreate ¶
func (*Client) SecretDelete ¶
SecretDelete removes the secret. The error tells, with docker.IsInUse, that a service still uses it.
func (*Client) SecretFind ¶
SecretFind returns the secret of that exact name, or nil.
func (*Client) SecretList ¶
func (*Client) SecretUpdate ¶
func (swarmClient *Client) SecretUpdate(ctx context.Context, existing *swarm.Secret, spec *swarm.SecretSpec) error
SecretUpdate replaces the labels of an existing secret: Swarm changes nothing else of a secret, its data least of all.
func (*Client) ServiceCreate ¶
func (swarmClient *Client) ServiceCreate(ctx context.Context, spec *swarm.ServiceSpec, registryAuth string) (string, error)
ServiceCreate creates the service. Swarm hands the encoded registry credentials to the nodes that pull its image.
func (*Client) ServiceDelete ¶
ServiceDelete removes the service. Swarm removes the containers of its tasks afterwards.
func (*Client) ServiceFind ¶
ServiceFind returns the service of that exact name, or nil.
func (*Client) ServiceList ¶
func (swarmClient *Client) ServiceList(ctx context.Context, filters client.Filters) ([]swarm.Service, error)
ServiceList lists services, with their task counts.
type Orchestrator ¶
type Orchestrator struct {
// contains filtered or unexported fields
}
Orchestrator applies compose projects to the swarm a manager's daemon runs.
func (*Orchestrator) Close ¶
func (orchestrator *Orchestrator) Close() error
func (*Orchestrator) Install ¶
func (orchestrator *Orchestrator) Install(ctx context.Context, project *installer.Project, opts installer.InstallOptions) error
Install creates what the project declares and is not there yet, the way docker stack deploy does: volumes, networks, configs and secrets, then the services, level after level, each waited for until it converged. It then deletes the services, configs and secrets the project no longer declares.
func (*Orchestrator) Name ¶
func (orchestrator *Orchestrator) Name() string
func (*Orchestrator) Uninstall ¶
func (orchestrator *Orchestrator) Uninstall(ctx context.Context, project *installer.Project, opts installer.UninstallOptions) error
Uninstall deletes what Install created from the project, as docker stack rm does: its services, then its configs and secrets, its networks, and its volumes when asked. What Install deleted as orphans is not looked for.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package convert turns a compose project into the specs of Swarm objects, the way docker stack deploy does (docker/cli, cli/compose/convert).
|
Package convert turns a compose project into the specs of Swarm objects, the way docker stack deploy does (docker/cli, cli/compose/convert). |