provisioning-catalog/components/fleet_agent/nickel/contracts.ncl

66 lines
2.1 KiB
Text
Raw Normal View History

let build_spec = import "schemas/lib/build_spec.ncl" in
let _concerns_lib = import "schemas/lib/concerns.ncl" in
{
FleetAgent = {
name | String,
version | String,
mode | [| 'systemd_unit |],
# Logical node id — must match the agent's subject namespace
# `fleet.libre-forge.nodes.<node_id>.command.>` that it subscribes to.
node_id | String,
# Physical host this taskserv installs on; usually equals node_id.
target_server | String,
# OCI reference to pull the binary from. Either a container image
# (`oras pull` + layer extraction) or a plain artifact reference.
image_ref | String,
# WebSocket endpoint of the fleet-daemon the agent dials outbound (adr-010).
# In-cluster: ws://fleet-daemon.fleet-system.svc:19012
# Off-cluster (external via NodePort): ws://<node-ip>:30191
daemon_url | String,
# Static resource declaration carried into the heartbeat capacity. Should
# match the underlying hcloud server_type so the daemon's KV view of the
# node matches reality.
declared | {
cpu | build_spec.BoundedCpu,
ram_gb | build_spec.PositiveNumber,
disk_gb | build_spec.PositiveNumber,
},
# Heartbeat cadence. Default 15s per daemon-agent-spec §3.1.
heartbeat_seconds | Number | default = 15,
# System user under which the agent runs. Created on install if absent.
# Hardening: NOT root; agent never needs privileged ops.
system_user | String | default = "fleet-agent",
requires | {
credentials | Array String | default = [],
capabilities | Array String | default = [],
} | default = {},
provides | {
service | String | optional,
interface | String | optional,
} | default = {},
operations | {
install | Bool | default = true,
update | Bool | default = true,
delete | Bool | default = false,
health | Bool | default = true,
} | default = {},
# ServiceConcerns: lightweight + cred-bearing. No backups (state is
# ephemeral; lifecycle hot view lives in fleet_nodes KV on the broker).
concerns | _concerns_lib.ServiceConcerns | optional,
..
},
}