Documentation
¶
Overview ¶
Package ateom registers an ateom worker with the control plane through the node-local atelet, reporting its compute capacity and hardware identity.
Index ¶
Constants ¶
const ( CapacityMountPath = "/run/ateom-capacity" CPULimitFile = "cpu_milli" MemoryLimitFile = "memory_bytes" )
Files the atecontroller projects into the ateom container from the downward API, in milli-cores and bytes.
Variables ¶
This section is empty.
Functions ¶
func FromFiles ¶
func FromFiles(actors int) *ateletpb.WorkerResources
FromFiles combines the downward API compute limits with the ateom's own actor limit.
A limit that is missing or unparseable is reported as zero, which the control plane reads as none: better to place nothing on a worker that cannot say what it has than to invent a number for it.
TODO: Watch the projected files and report changes. For now we do not support in-place Pod vertical scaling (IPPR); capacity is read once at startup. NOTE: Please do not implement this yet. IPPR needs more general consideration.
func Report ¶
func Report(ctx context.Context, cfg ReportConfig) error
Report tells the node-local atelet what this ateom can supply and its hardware identity, retrying until it is accepted or ctx ends.
Retrying is what makes a single report durable: atelet only accepts once the control plane has recorded it, and the Worker record may not exist yet when an ateom first comes up. Nothing else reports this, so giving up would leave the Worker holding no capacity and hosting nothing.
Types ¶
type ReportConfig ¶
type ReportConfig struct {
SocketPath string
CredentialBundlePath string
TrustBundlePath string
// AteletSPIFFEID is the identity the node-local atelet must present. It
// names atelet's namespace, not this worker's, so it is configured rather
// than derived from the downward API.
AteletSPIFFEID string
// Actors is how many actors this ateom will host at once.
Actors int
}
ReportConfig is what an ateom needs to reach the atelet on its node.