package cluster
import "github.com/docker/docker/daemon/cluster"
Index ¶
- Variables
- type Cluster
- func New(config Config) (*Cluster, error)
- func (c *Cluster) Cleanup()
- func (c *Cluster) CreateNetwork(s apitypes.NetworkCreateRequest) (string, error)
- func (c *Cluster) CreateService(s types.ServiceSpec, encodedAuth string) (string, error)
- func (c *Cluster) GetAdvertiseAddress() string
- func (c *Cluster) GetLocalAddress() string
- func (c *Cluster) GetNetwork(input string) (apitypes.NetworkResource, error)
- func (c *Cluster) GetNetworks() ([]apitypes.NetworkResource, error)
- func (c *Cluster) GetNode(input string) (types.Node, error)
- func (c *Cluster) GetNodes(options apitypes.NodeListOptions) ([]types.Node, error)
- func (c *Cluster) GetRemoteAddress() string
- func (c *Cluster) GetService(input string) (types.Service, error)
- func (c *Cluster) GetServices(options apitypes.ServiceListOptions) ([]types.Service, error)
- func (c *Cluster) GetTask(input string) (types.Task, error)
- func (c *Cluster) GetTasks(options apitypes.TaskListOptions) ([]types.Task, error)
- func (c *Cluster) Info() types.Info
- func (c *Cluster) Init(req types.InitRequest) (string, error)
- func (c *Cluster) Inspect() (types.Swarm, error)
- func (c *Cluster) IsAgent() bool
- func (c *Cluster) IsManager() bool
- func (c *Cluster) Join(req types.JoinRequest) error
- func (c *Cluster) Leave(force bool) error
- func (c *Cluster) ListenClusterEvents() <-chan struct{}
- func (c *Cluster) RemoveNetwork(input string) error
- func (c *Cluster) RemoveNode(input string) error
- func (c *Cluster) RemoveService(input string) error
- func (c *Cluster) Update(version uint64, spec types.Spec, flags types.UpdateFlags) error
- func (c *Cluster) UpdateNode(nodeID string, version uint64, spec types.NodeSpec) error
- func (c *Cluster) UpdateService(serviceID string, version uint64, spec types.ServiceSpec, encodedAuth string) error
- type Config
- type NetworkSubnetsProvider
Variables ¶
ErrNoSwarm is returned on leaving a cluster that was never initialized
ErrPendingSwarmExists is returned on initialize or join request for a cluster that is already processing a similar request but has not succeeded yet.
var ErrSwarmExists = fmt.Errorf("This node is already part of a swarm cluster. Use \"docker swarm leave\" to leave this cluster and join another one.")
ErrSwarmExists is returned on initialize or join request for a cluster that has already been activated
ErrSwarmJoinTimeoutReached is returned when cluster join could not complete before timeout was reached.
Types ¶
type Cluster ¶
Cluster provides capabilities to participate in a cluster as a worker or a manager.
func New ¶
New creates a new Cluster instance using provided config.
func (*Cluster) Cleanup ¶
func (c *Cluster) Cleanup()
Cleanup stops active swarm node. This is run before daemon shutdown.
func (*Cluster) CreateNetwork ¶
func (c *Cluster) CreateNetwork(s apitypes.NetworkCreateRequest) (string, error)
CreateNetwork creates a new cluster managed network.
func (*Cluster) CreateService ¶
CreateService creates a new service in a managed swarm cluster.
func (*Cluster) GetAdvertiseAddress ¶
GetAdvertiseAddress returns the remotely reachable address of this node.
func (*Cluster) GetLocalAddress ¶
GetLocalAddress returns the local address.
func (*Cluster) GetNetwork ¶
func (c *Cluster) GetNetwork(input string) (apitypes.NetworkResource, error)
GetNetwork returns a cluster network by an ID.
func (*Cluster) GetNetworks ¶
func (c *Cluster) GetNetworks() ([]apitypes.NetworkResource, error)
GetNetworks returns all current cluster managed networks.
func (*Cluster) GetNode ¶
GetNode returns a node based on an ID or name.
func (*Cluster) GetNodes ¶
GetNodes returns a list of all nodes known to a cluster.
func (*Cluster) GetRemoteAddress ¶
GetRemoteAddress returns a known advertise address of a remote manager if available. todo: change to array/connect with info
func (*Cluster) GetService ¶
GetService returns a service based on an ID or name.
func (*Cluster) GetServices ¶
GetServices returns all services of a managed swarm cluster.
func (*Cluster) GetTask ¶
GetTask returns a task by an ID.
func (*Cluster) GetTasks ¶
GetTasks returns a list of tasks matching the filter options.
func (*Cluster) Info ¶
Info returns information about the current cluster state.
func (*Cluster) Init ¶
func (c *Cluster) Init(req types.InitRequest) (string, error)
Init initializes new cluster from user provided request.
func (*Cluster) Inspect ¶
Inspect retrieves the configuration properties of a managed swarm cluster.
func (*Cluster) IsAgent ¶
IsAgent returns true if Cluster is participating as a worker/agent.
func (*Cluster) IsManager ¶
IsManager returns true if Cluster is participating as a manager.
func (*Cluster) Join ¶
func (c *Cluster) Join(req types.JoinRequest) error
Join makes current Cluster part of an existing swarm cluster.
func (*Cluster) Leave ¶
Leave shuts down Cluster and removes current state.
func (*Cluster) ListenClusterEvents ¶
func (c *Cluster) ListenClusterEvents() <-chan struct{}
ListenClusterEvents returns a channel that receives messages on cluster participation changes. todo: make cancelable and accessible to multiple callers
func (*Cluster) RemoveNetwork ¶
RemoveNetwork removes a cluster network.
func (*Cluster) RemoveNode ¶
RemoveNode removes a node from a cluster
func (*Cluster) RemoveService ¶
RemoveService removes a service from a managed swarm cluster.
func (*Cluster) Update ¶
Update updates configuration of a managed swarm cluster.
func (*Cluster) UpdateNode ¶
UpdateNode updates existing nodes properties.
func (*Cluster) UpdateService ¶
func (c *Cluster) UpdateService(serviceID string, version uint64, spec types.ServiceSpec, encodedAuth string) error
UpdateService updates existing service to match new properties.
type Config ¶
type Config struct { Root string Name string Backend executorpkg.Backend NetworkSubnetsProvider NetworkSubnetsProvider // DefaultAdvertiseAddr is the default host/IP or network interface to use // if no AdvertiseAddr value is specified. DefaultAdvertiseAddr string }
Config provides values for Cluster.
type NetworkSubnetsProvider ¶
NetworkSubnetsProvider exposes functions for retrieving the subnets of networks managed by Docker, so they can be filtered.
Source Files ¶
cluster.go filters.go helpers.go listen_addr.go
Directories ¶
Path | Synopsis |
---|---|
daemon/cluster/convert | |
daemon/cluster/executor | |
daemon/cluster/executor/container | |
daemon/cluster/provider |
- Version
- v1.12.0
- Published
- Jul 28, 2016
- Platform
- js/wasm
- Imports
- 26 packages
- Last checked
- 2 minutes ago –
Tools for package owners.