Documentation ¶
Index ¶
- Variables
- type Config
- type Node
- func (n *Node) Agent() *agent.Agent
- func (n *Node) BindRemote(ctx context.Context, listenAddr string, advertiseAddr string) error
- func (n *Node) DowngradeKey() error
- func (n *Node) Err(ctx context.Context) error
- func (n *Node) IsStateDirty() (bool, 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 ¶
var ( // ErrInvalidUnlockKey is returned when we can't decrypt the TLS certificate ErrInvalidUnlockKey = errors.New("node is locked, and needs a valid unlock key") // ErrMandatoryFIPS is returned when the cluster we are joining mandates FIPS, but we are running in non-FIPS mode ErrMandatoryFIPS = errors.New("node is not FIPS-enabled but cluster requires FIPS") )
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 // NetworkConfig stores network related config for the cluster NetworkConfig *cnmallocator.NetworkConfig // 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 // PluginGetter provides access to docker's plugin inventory. PluginGetter plugingetter.PluginGetter // FIPS is a boolean stating whether the node is FIPS enabled FIPS bool }
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) BindRemote ¶
BindRemote starts a listener that exposes the remote API.
func (*Node) DowngradeKey ¶
DowngradeKey reverts the node key to older format so that it can run on older version of swarmkit
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) IsStateDirty ¶
IsStateDirty returns true if any objects have been added to raft which make the state "dirty". Currently, the existence of any object other than the default cluster or the local node implies a dirty state.
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.