AgentSchedule CRD
An AgentSchedule runs a prompt, or a built-in schedule’s helper script, on an AgentProfile on a cron schedule. When a slot comes due, the operator submits the run through the A2A gateway as an Unattended task, and the profile dispatcher runs it. It is the replacement for the Hermes cron rosters (scheduling on profiles).
Off by default. The operator reads schedules and submits their runs only with its A2A_AGENT_SCHEDULES flag set to true. Without it the API server stores schedules and nothing fires. The chart ships no schedules.
apiVersion: kubeagents.x-k8s.io/v1alpha1kind: AgentSchedulemetadata: name: compliance-audit namespace: kubeagents-system labels: kubeagents.x-k8s.io/origin: builtin # builtin | userspec: schedule: "20 6 * * *" # 5 fields, UTC profileRef: name: fleet-audit # must allow the unattended tier prompt: Run the daily compliance audit. delivery: mode: chat # or local silentWhenClean: true- The
kubeagents.x-k8s.io/originlabel says who owns a schedule. A schedule runs asbuiltinonly when it readsbuiltin, the install’sPlatformAgentis its controller, and its name is one of the built-in schedules thatPlatformAgentrenders. Only the operator may set, change or remove thebuiltinlabel or a controller reference, or change a built-in schedule’s spec (exceptspec.suspend): an admission policy (kube-agents-agentschedule-builtin) refuses anyone else. Annotations such asrun-now, and suspending a built-in schedule (spec.suspend), still pass. A schedule labelledbuiltinthat isn’t one the operator renders readsAccepted=False(BuiltinNotFromOperator). Any other schedule is a user schedule. User schedules wait on a later change, so for now one readsAccepted=False(UserSchedulesDeferred) and never fires. - The name is a dot-free DNS-1123 label of at most 63 characters, because each run’s trigger is
schedule/<name>. A schedule with any other name readsAccepted=False(InvalidName). - Each run either asks
prompt, or runsscriptwith no model turn; a schedule sets exactly one of them.scriptnames one of the profile’sspec.scripts, by name, never a path. Only a built-in schedule may name a script: any other schedule that does readsAccepted=False(InvalidSchedule) and never fires. A script the profile’sspec.scriptsdoesn’t list readsAccepted=False(ProfileScriptUnknown), and the schedule is accepted once the profile lists it, with no edit to the schedule. A script schedule takes noskillsormaxTurns; the API server refuses one that sets either. scheduleis a standard 5-field cron expression, read in UTC, as a KubernetesCronJobreads it. It takes no time zone prefix.profileRefnames anAgentProfilein the same namespace whoseallowedTiersincludesunattended. A schedule whose profile is missing or doesn’t allow it readsAccepted=Falseand never fires.concurrencyPolicyisForbid, the only value: a slot that comes due while the last run is still going is skipped and counted instatus.skipCounts.alreadyRunning.- The operator renders the built-in schedules while schedules are on, and none ships yet. A built-in’s name is reserved: a schedule you create under one is deleted and replaced by the built-in. Pause a built-in through the PlatformAgent’s
spec.schedules.overrides, keyed on the schedule’s name, or pause every built-in but a run-now-only one withspec.schedules.suspendAll. WhilesuspendAllis set, the operator puts back aspec.suspendyou clear on the schedule itself; use an override withsuspend: falseto run one. parameters(at most 16) go to each run as task parameters. A built-in schedule’s report stream is its own name, carried on its trigger, never a parameter.delivery.jobKeygroups a schedule’s posts into one thread per UTC day. It’s a DNS-1123 label, defaulting to the schedule’s name.startingDeadlineSeconds(default 900) is how late a slot may still start. After an outage, one late slot runs if it is still inside the deadline, and the rest are counted once instatus.skipCounts.missedWindow.activeDeadlineSecondsbounds a run, defaulting to the profile’slifecycle.activeDeadlineSeconds, the ceiling its Job runs under. A run that reports no end within it plus five minutes is recordedLost, and the schedule moves on.suspend: trueskips every slot. A slot that passes while suspended is counted, not run later. Arun-nowstill runs: it is an explicit request.- Editing the spec (a new
schedule, say) moves the next slot to the new schedule’s next one from now.
Run it now. Setting the annotation kubeagents.x-k8s.io/run-now to a new value starts one run, or adopts the run already in flight, without moving the cadence:
kubectl annotate agentschedule compliance-audit kubeagents.x-k8s.io/run-now="$(date -u +%s)" --overwriteStop the run in flight. Setting the annotation kubeagents.x-k8s.io/stop to a new value ends the schedule’s current run through the A2A gateway. A running task is canceled, and one still starting has its Job removed. The run is recorded as Cancelled, and the next slot runs as usual:
kubectl annotate agentschedule compliance-audit kubeagents.x-k8s.io/stop="$(date -u +%s)" --overwriteThe value is recorded in status.lastHandledStop once acted on, so the same value never stops a later run. With no run in flight, the value is recorded and nothing else happens. A slot still being submitted isn’t dropped, because the gateway may already have taken it: the stop waits until it becomes a run, then stops it. A run-now set after a stop starts a new run once the stopped one has ended.
A stop that is still being retried, because the gateway hasn’t answered yet, stays in effect if the annotation is removed or set back. A run-now set meanwhile still waits for that run to end, then starts a new one. The gateway stops only a run it started for this schedule.
Status is the run ledger. No run state lives in a pod: status holds the next and last slots, the run in flight, the last outcome, the skip counts and the last ten runs. status.lastReason says why the last run ended, as the bare reason token the gateway names, such as deadline-exceeded. Each recent run keeps its own reason, and the Reason column of kubectl get agentschedules shows the last one.
A slot is claimed in status.pendingSlot before its submission, with an idempotency key the gateway answers with the same task, so an operator restart neither runs a slot twice nor drops it. The operator also exports kubeagents_schedule_runs_total{schedule,outcome} and kubeagents_schedule_skips_total{schedule,reason}. The Submitted condition shows how the gateway answered the last submission. It reads False (GatewayRefused, with the gateway’s reason) when the gateway refused a run, which drops that slot without retrying it.
Only the operator writes a schedule’s status, and no agent ServiceAccount can write AgentSchedule resources.
See AgentSchedule fields for every field.