Documentation
¶
Index ¶
- Variables
- type Config
- type Node
- func (n *Node) Agent() *agent.Agent
- func (n *Node) Err(ctx context.Context) error
- func (n *Node) ListenControlSocket(ctx context.Context) <-chan *grpc.ClientConn
- func (n *Node) Manager() *manager.Manager
- func (n *Node) NodeID() string
- func (n *Node) Ready() <-chan struct{}
- func (n *Node) RemoteAPIAddr() (string, error)
- func (n *Node) Remotes() []api.Peer
- func (n *Node) Start(ctx context.Context) error
- func (n *Node) Stop(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidUnlockKey is returned when we can't decrypt the TLS certificate ErrInvalidUnlockKey = errors.New("node is locked, and needs a valid unlock key") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Hostname is the name of host for agent instance.
Hostname string
// JoinAddr specifies node that should be used for the initial connection to
// other manager in cluster. This should be only one address and optional,
// the actual remotes come from the stored state.
JoinAddr string
// StateDir specifies the directory the node uses to keep the state of the
// remote managers and certificates.
StateDir string
// JoinToken is the token to be used on the first certificate request.
JoinToken string
// ExternalCAs is a list of CAs to which a manager node
// will make certificate signing requests for node certificates.
ExternalCAs []*api.ExternalCA
// ForceNewCluster creates a new cluster from current raft state.
ForceNewCluster bool
// ListenControlAPI specifies address the control API should listen on.
ListenControlAPI string
// ListenRemoteAPI specifies the address for the remote API that agents
// and raft members connect to.
ListenRemoteAPI string
// AdvertiseRemoteAPI specifies the address that should be advertised
// for connections to the remote API (including the raft service).
AdvertiseRemoteAPI string
// Executor specifies the executor to use for the agent.
Executor exec.Executor
// ElectionTick defines the amount of ticks needed without
// leader to trigger a new election
ElectionTick uint32
// HeartbeatTick defines the amount of ticks between each
// heartbeat sent to other members for health-check purposes
HeartbeatTick uint32
// AutoLockManagers determines whether or not an unlock key will be generated
// when bootstrapping a new cluster for the first time
AutoLockManagers bool
// UnlockKey is the key to unlock a node - used for decrypting at rest. This
// only applies to nodes that have already joined a cluster.
UnlockKey []byte
// Availability allows a user to control the current scheduling status of a node
Availability api.NodeSpec_Availability
}
Config provides values for a Node.
type Node ¶
Node implements the primary node functionality for a member of a swarm cluster. Node handles workloads and may also run as a manager.
func (*Node) Err ¶
Err returns the error that caused the node to shutdown or nil. Err blocks until the node has fully shut down.
func (*Node) ListenControlSocket ¶
func (n *Node) ListenControlSocket(ctx context.Context) <-chan *grpc.ClientConn
ListenControlSocket listens changes of a connection for managing the cluster control api
func (*Node) Ready ¶
func (n *Node) Ready() <-chan struct{}
Ready returns a channel that is closed after node's initialization has completes for the first time.
func (*Node) RemoteAPIAddr ¶
RemoteAPIAddr returns address on which remote manager api listens. Returns nil if node is not manager.
Click to show internal directories.
Click to hide internal directories.