Documentation
¶
Overview ¶
Package daemon runs a Jokku node. The control node runs the store, the API, the scheduler and an agent; a worker (one with a node.json from joining a cluster) runs only an agent that follows the control node.
Index ¶
Constants ¶
View Source
const ( DefaultDataDir = "/var/lib/jokku" DefaultUser = "jokku" DefaultClusterCIDR = "10.210.0.0/16" )
Defaults for a server installed by install.sh / "jokku setup".
Variables ¶
This section is empty.
Functions ¶
func OutboundIP ¶
func OutboundIP() string
OutboundIP is exported for setup, which advertises it when joining.
func SaveNodeFile ¶
func TotalMemoryMB ¶
func TotalMemoryMB() int
TotalMemoryMB is this machine's memory, reported when joining a cluster.
Types ¶
type Config ¶
type Config struct {
DataDir string // state and builds, e.g. /var/lib/jokku
Socket string // API socket, e.g. /run/jokku/jokku.sock
GitDir string // bare repos; defaults to <DataDir>/git
// GitUser is the account sshd runs git and CLI commands as. It owns the
// repos and authorized_keys and may use the socket. Empty means the
// current user (local development).
GitUser string
// AuthorizedKeys defaults to ~GitUser/.ssh/authorized_keys. "-" disables
// writing it.
AuthorizedKeys string
ClusterCIDR string
NodeName string
// Advertise is the address other nodes reach this one at; default the
// address used to reach the internet.
Advertise string
// APIListen is the TLS listener for joins and agents; "-" disables it.
APIListen string
}
type NodeFile ¶
type NodeFile struct {
Role string `json:"role"` // "worker" or "edge"
Control string `json:"control"` // the control node's API, host:7443 (an edge's is over the mesh)
Pin string `json:"pin"` // its TLS key
NodeToken string `json:"node_token"` // this node's credential with the control node
AgentToken string `json:"agent_token"` // the control node's credential with this node
Node types.NodeIdentity `json:"node"`
// Peers, on an edge, are the mesh peers to start with (the control
// node), until the control node sends the rest.
Peers []types.Peer `json:"peers,omitempty"`
}
NodeFile is a worker's or an edge's identity and credentials, written when it joins a cluster. Its presence is what makes the daemon run as one.
func LoadNodeFile ¶
Click to show internal directories.
Click to hide internal directories.