Documentation ¶
Index ¶
- type Cluster
- func (c *Cluster) AttachNetwork(target string, containerID string, addresses []string) (*network.NetworkingConfig, error)
- func (c *Cluster) Cleanup()
- func (c *Cluster) CreateConfig(s types.ConfigSpec) (string, error)
- func (c *Cluster) CreateNetwork(s apitypes.NetworkCreateRequest) (string, error)
- func (c *Cluster) CreateSecret(s types.SecretSpec) (string, error)
- func (c *Cluster) CreateService(s swarm.ServiceSpec, encodedAuth string, queryRegistry bool) (*swarm.ServiceCreateResponse, error)
- func (c *Cluster) CreateVolume(v volumetypes.CreateOptions) (*volumetypes.Volume, error)
- func (c *Cluster) DetachNetwork(target string, containerID string) error
- func (c *Cluster) GetAdvertiseAddress() string
- func (c *Cluster) GetConfig(input string) (types.Config, error)
- func (c *Cluster) GetConfigs(options apitypes.ConfigListOptions) ([]types.Config, error)
- func (c *Cluster) GetDataPathAddress() string
- func (c *Cluster) GetListenAddress() string
- func (c *Cluster) GetLocalAddress() string
- func (c *Cluster) GetNetwork(input string) (apitypes.NetworkResource, error)
- func (c *Cluster) GetNetworks(filter filters.Args) ([]apitypes.NetworkResource, error)
- func (c *Cluster) GetNetworksByName(name string) ([]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) GetRemoteAddressList() []string
- func (c *Cluster) GetSecret(input string) (types.Secret, error)
- func (c *Cluster) GetSecrets(options apitypes.SecretListOptions) ([]types.Secret, error)
- func (c *Cluster) GetService(input string, insertDefaults bool) (swarm.Service, error)
- func (c *Cluster) GetServices(options types.ServiceListOptions) ([]swarm.Service, error)
- func (c *Cluster) GetTask(input string) (types.Task, error)
- func (c *Cluster) GetTasks(options apitypes.TaskListOptions) ([]types.Task, error)
- func (c *Cluster) GetUnlockKey() (string, error)
- func (c *Cluster) GetVolume(nameOrID string) (volumetypes.Volume, error)
- func (c *Cluster) GetVolumes(options volumetypes.ListOptions) ([]*volumetypes.Volume, error)
- func (c *Cluster) GetWatchStream() chan *swarmapi.WatchMessage
- 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(ctx context.Context, force bool) error
- func (c *Cluster) ListenClusterEvents() <-chan lncluster.ConfigEventType
- func (c *Cluster) RemoveConfig(input string) error
- func (c *Cluster) RemoveNetwork(input string) error
- func (c *Cluster) RemoveNode(input string, force bool) error
- func (c *Cluster) RemoveSecret(input string) error
- func (c *Cluster) RemoveService(input string) error
- func (c *Cluster) RemoveVolume(nameOrID string, force bool) error
- func (c *Cluster) SendClusterEvent(event lncluster.ConfigEventType)
- func (c *Cluster) ServiceLogs(ctx context.Context, selector *backend.LogSelector, ...) (<-chan *backend.LogMessage, error)
- func (c *Cluster) Start() error
- func (c *Cluster) Status() string
- func (c *Cluster) UnlockSwarm(req types.UnlockRequest) error
- func (c *Cluster) Update(version uint64, spec types.Spec, flags types.UpdateFlags) error
- func (c *Cluster) UpdateAttachment(target, containerID string, config *network.NetworkingConfig) error
- func (c *Cluster) UpdateConfig(input string, version uint64, spec types.ConfigSpec) error
- func (c *Cluster) UpdateNode(input string, version uint64, spec types.NodeSpec) error
- func (c *Cluster) UpdateSecret(input string, version uint64, spec types.SecretSpec) error
- func (c *Cluster) UpdateService(serviceIDOrName string, version uint64, spec swarm.ServiceSpec, ...) (*swarm.ServiceUpdateResponse, error)
- func (c *Cluster) UpdateVolume(nameOrID string, version uint64, volume volumetypes.UpdateOptions) error
- func (c *Cluster) WaitForDetachment(ctx context.Context, networkName, networkID, taskID, containerID string) error
- type Config
- type NetworkSubnetsProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster provides capabilities to participate in a cluster as a worker or a manager.
func (*Cluster) AttachNetwork ¶
func (c *Cluster) AttachNetwork(target string, containerID string, addresses []string) (*network.NetworkingConfig, error)
AttachNetwork generates an attachment request towards the manager.
func (*Cluster) Cleanup ¶
func (c *Cluster) Cleanup()
Cleanup stops active swarm node. This is run before daemon shutdown.
func (*Cluster) CreateConfig ¶
func (c *Cluster) CreateConfig(s types.ConfigSpec) (string, error)
CreateConfig creates a new config in a managed swarm cluster.
func (*Cluster) CreateNetwork ¶
func (c *Cluster) CreateNetwork(s apitypes.NetworkCreateRequest) (string, error)
CreateNetwork creates a new cluster managed network.
func (*Cluster) CreateSecret ¶
func (c *Cluster) CreateSecret(s types.SecretSpec) (string, error)
CreateSecret creates a new secret in a managed swarm cluster.
func (*Cluster) CreateService ¶
func (c *Cluster) CreateService(s swarm.ServiceSpec, encodedAuth string, queryRegistry bool) (*swarm.ServiceCreateResponse, error)
CreateService creates a new service in a managed swarm cluster.
func (*Cluster) CreateVolume ¶
func (c *Cluster) CreateVolume(v volumetypes.CreateOptions) (*volumetypes.Volume, error)
CreateVolume creates a new cluster volume in the swarm cluster.
Returns the volume ID if creation is successful, or an error if not.
func (*Cluster) DetachNetwork ¶
DetachNetwork unblocks the waiters waiting on WaitForDetachment so that a request to detach can be generated towards the manager.
func (*Cluster) GetAdvertiseAddress ¶
GetAdvertiseAddress returns the remotely reachable address of this node.
func (*Cluster) GetConfigs ¶
GetConfigs returns all configs of a managed swarm cluster.
func (*Cluster) GetDataPathAddress ¶
GetDataPathAddress returns the address to be used for the data path traffic, if specified.
func (*Cluster) GetListenAddress ¶
GetListenAddress returns the listen address.
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 ¶
GetNetworks returns all current cluster managed networks.
func (*Cluster) GetNetworksByName ¶
func (c *Cluster) GetNetworksByName(name string) ([]apitypes.NetworkResource, error)
GetNetworksByName returns cluster managed networks by name. It is ok to have multiple networks here. #18864
func (*Cluster) GetRemoteAddressList ¶
GetRemoteAddressList returns the advertise address for each of the remote managers if available.
func (*Cluster) GetSecrets ¶
GetSecrets returns all secrets of a managed swarm cluster.
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) GetUnlockKey ¶
GetUnlockKey returns the unlock key for the swarm.
func (*Cluster) GetVolume ¶
func (c *Cluster) GetVolume(nameOrID string) (volumetypes.Volume, error)
GetVolume returns a volume from the swarm cluster.
func (*Cluster) GetVolumes ¶
func (c *Cluster) GetVolumes(options volumetypes.ListOptions) ([]*volumetypes.Volume, error)
GetVolumes returns all of the volumes matching the given options from a swarm cluster.
func (*Cluster) GetWatchStream ¶
func (c *Cluster) GetWatchStream() chan *swarmapi.WatchMessage
GetWatchStream returns the channel to pass changes from store watch API
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) Join ¶
func (c *Cluster) Join(req types.JoinRequest) error
Join makes current Cluster part of an existing swarm cluster.
func (*Cluster) ListenClusterEvents ¶
func (c *Cluster) ListenClusterEvents() <-chan lncluster.ConfigEventType
ListenClusterEvents returns a channel that receives messages on cluster participation changes. todo: make cancelable and accessible to multiple callers
func (*Cluster) RemoveConfig ¶
RemoveConfig removes a config from a managed swarm cluster.
func (*Cluster) RemoveNetwork ¶
RemoveNetwork removes a cluster network.
func (*Cluster) RemoveNode ¶
RemoveNode removes a node from a cluster
func (*Cluster) RemoveSecret ¶
RemoveSecret removes a secret from a managed swarm cluster.
func (*Cluster) RemoveService ¶
RemoveService removes a service from a managed swarm cluster.
func (*Cluster) RemoveVolume ¶
RemoveVolume removes a volume from the swarm cluster.
func (*Cluster) SendClusterEvent ¶
func (c *Cluster) SendClusterEvent(event lncluster.ConfigEventType)
SendClusterEvent allows to send cluster events on the configEvent channel TODO This method should not be exposed. Currently it is used to notify the network controller that the keys are available
func (*Cluster) ServiceLogs ¶
func (c *Cluster) ServiceLogs(ctx context.Context, selector *backend.LogSelector, config *container.LogsOptions) (<-chan *backend.LogMessage, error)
ServiceLogs collects service logs and writes them back to `config.OutStream`
func (*Cluster) Start ¶
Start the Cluster instance TODO The split between New and Start can be join again when the SendClusterEvent method is no longer required
func (*Cluster) Status ¶
Status returns a textual representation of the node's swarm status and role (manager/worker)
func (*Cluster) UnlockSwarm ¶
func (c *Cluster) UnlockSwarm(req types.UnlockRequest) error
UnlockSwarm provides a key to decrypt data that is encrypted at rest.
func (*Cluster) UpdateAttachment ¶
func (c *Cluster) UpdateAttachment(target, containerID string, config *network.NetworkingConfig) error
UpdateAttachment signals the attachment config to the attachment waiter who is trying to start or attach the container to the network.
func (*Cluster) UpdateConfig ¶
UpdateConfig updates a config in a managed swarm cluster. Note: this is not exposed to the CLI but is available from the API only
func (*Cluster) UpdateNode ¶
UpdateNode updates existing nodes properties.
func (*Cluster) UpdateSecret ¶
UpdateSecret updates a secret in a managed swarm cluster. Note: this is not exposed to the CLI but is available from the API only
func (*Cluster) UpdateService ¶
func (c *Cluster) UpdateService(serviceIDOrName string, version uint64, spec swarm.ServiceSpec, flags types.ServiceUpdateOptions, queryRegistry bool) (*swarm.ServiceUpdateResponse, error)
UpdateService updates existing service to match new properties.
func (*Cluster) UpdateVolume ¶
func (c *Cluster) UpdateVolume(nameOrID string, version uint64, volume volumetypes.UpdateOptions) error
UpdateVolume updates a volume in the swarm cluster.
type Config ¶
type Config struct { Root string Name string Backend executorpkg.Backend ImageBackend executorpkg.ImageBackend PluginBackend plugin.Backend VolumeBackend executorpkg.VolumeBackend NetworkSubnetsProvider NetworkSubnetsProvider // DefaultAdvertiseAddr is the default host/IP or network interface to use // if no AdvertiseAddr value is specified. DefaultAdvertiseAddr string // path to store runtime state, such as the swarm control socket RuntimeRoot string // WatchStream is a channel to pass watch API notifications to daemon WatchStream chan *swarmapi.WatchMessage // RaftHeartbeatTick is the number of ticks for heartbeat of quorum members RaftHeartbeatTick uint32 // RaftElectionTick is the number of ticks to elapse before followers propose a new round of leader election // This value should be 10x that of RaftHeartbeatTick RaftElectionTick uint32 }
Config provides values for Cluster.