Documentation
¶
Overview ¶
Package ateomcapacity reports what an ateom can supply to the actors it hosts. Both ateoms answer GetCapacity from here so they answer it alike.
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() *ateletpb.SetWorkerCapacityRequest
FromFiles reads the ateom's compute limits from its downward API volume, as the report it sends to the node-local atelet.
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, 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 ¶
ReportConfig is what an ateom needs to reach the atelet on its node.