Last reviewed: November 14, 2026 (Asia/Shanghai); references checked November 13 UTC.

Direct answer

CometAPI CronJob cost controls need a durable identity for each intended report occurrence and a single-use dispatch claim before generation. Use Kubernetes scheduling, overlap, and retry settings to reduce unwanted worker starts, then require every worker to pass the same application budget authority. A duplicate worker must find existing state instead of purchasing the report again.

Kubernetes’ CronJob reference says scheduling is approximate: two Jobs, or no Job, can be created for an execution time. Its Forbid policy applies only to Jobs created by the same CronJob. Neither a cron expression nor a concurrency policy establishes a maximum number of CometAPI calls.

Who this is for

This guide is for platform engineers and AI cost owners running periodic CometAPI summaries or reports in Kubernetes. It assumes you control the worker, durable workload state, and outbound model adapter. The recommendations focus on preventing repeated generation for one intended occurrence.

The manifest is an illustrative configuration fragment, and the verification matrix contains acceptance criteria. No cluster deployment, authenticated model call, or billing experiment was performed for this article. Mandatory historical processing needs an explicit completion policy before missed work is discarded.

Key takeaways

  • Count intended occurrences, Jobs, worker starts, and model attempts separately.
  • Use a business occurrence identity that survives duplicate Jobs and CronJob recreation.
  • Distinguish the deadline for creating a Job from worker runtime and report usefulness.
  • Treat Forbid, backoffLimit, and restartPolicy as Kubernetes controls with limited scope.
  • Keep uncertain upstream attempts reserved when a Pod exits or a Job is replaced.
  • Approve catch-up work through the same shared budget as ordinary scheduled work.

Contract details to verify

Identify the occurrence before counting attempts

A scheduled report can have several identities:

IdentityWhat it representsSuitable financial use
Workload and intended scheduled instantOne business occurrenceDeduplicate the intended report
Kubernetes Job UIDOne controller-created JobTrace infrastructure execution
Pod UID and process startOne worker executionDiagnose restarts and replacements
Application attempt IDOne authorized model attemptReserve, dispatch, and settle usage

A Job UID cannot deduplicate two different Jobs created for the same occurrence. A Pod UID changes on replacement. Using the worker’s current startup time creates a fresh identity whenever it restarts.

Starting with Kubernetes v1.32, the CronJob reference documents the batch.kubernetes.io/cronjob-scheduled-timestamp annotation on created Jobs. It records the originally scheduled creation time in RFC3339 format. A trusted controller or worker can resolve its owning Job and validate that value. It is not automatically a Pod annotation or an environment variable. Grant only the required metadata access or pass validated context through a trusted integration.

Build an application occurrence key from the workload scope and intended instant normalized to UTC. Persist the bound input revision, report definition, route, and cost-policy revision alongside it. A duplicate presenting different bindings should be held for review; changing the prompt must not quietly authorize a second report for the same occurrence.

Keep the business workload identity across CronJob deletion and recreation. A deliberate rerun needs an explicit new authorization linked to the original occurrence. Manual Jobs need a validated occurrence or rerun identity too. Missing scheduling metadata should prevent unattended generation rather than fall back to now().

Separate three time controls

ControlWhat it boundsWhat it does not establish
CronJob startingDeadlineSecondsHow late the controller may create a Job for an occurrenceWhether a later-starting Pod’s report is still useful
Job activeDeadlineSecondsActive Job duration across its PodsCancellation or zero usage for an external model request
Application occurrence deadlineWhether the worker may hand off this report attemptWhether remote completion will occur before that deadline

The Jobs reference says the Job’s active deadline takes precedence over its backoff limit and terminates running Pods when exceeded. Those are cluster lifecycle consequences. Do not infer that terminating a Pod reverses an already transmitted CometAPI call.

Derive the report’s latest permitted handoff from its original occurrence, then check it after capacity waits and immediately before dispatch. A Job created within its starting deadline can still sit Pending or wait locally. Use the site’s stale-job expiration workflow for the final freshness decision.

Check current catch-up semantics

The current CronJob reference says unsuspending a CronJob without a starting deadline starts a Job for the most recent missed schedule immediately; earlier missed schedules are not started. It also says that more than 100 missed schedules produce a TooManyMissedTimes warning while a Job for the most recent missed schedule still starts. Do not forecast a replay of every missed tick from this controller behavior.

These details are version-sensitive. Check your deployed controller and its matching documentation. Application replay tools, manual reruns, multiple CronJobs, and multiple clusters can create additional work independently. A resume procedure must inventory those paths too.

Forbid can skip a scheduled run while the previous Job is unfinished. The reference notes that a new Job can still be created after the previous one finishes, taking the starting deadline into account. It is not a permanent instruction to discard all delayed work. suspend: true prevents future starts but does not stop Jobs already started, and editing a CronJob’s template changes future Jobs without updating existing ones.

Operator workflow

Reduce unnecessary Kubernetes executions

The following fragment belongs under a CronJob’s spec. Supply the worker container and other required Pod settings before using it. It assumes a report every 15 minutes, Job creation allowed up to two minutes late, and a five-minute Job runtime allowance. Choose those values from the actual workload policy.

schedule: "*/15 * * * *"
timeZone: "Etc/UTC"
concurrencyPolicy: Forbid
startingDeadlineSeconds: 120
suspend: false
jobTemplate:
  spec:
    completions: 1
    parallelism: 1
    backoffLimit: 0
    activeDeadlineSeconds: 300
    template:
      spec:
        restartPolicy: Never
        # Add the approved worker container and Pod configuration here.

timeZone is stable from Kubernetes v1.27. Use the dedicated field rather than embedding TZ or CRON_TZ in the schedule. Avoid using a starting deadline below ten seconds: the CronJob reference warns that the controller’s ten-second check interval can prevent scheduling.

Here, Forbid reduces ordinary overlap within this CronJob, restartPolicy: Never prevents in-Pod container restarts, and backoffLimit: 0 disables the normal failed-Pod retry allowance. They do not produce exactly-once external execution. The Jobs reference explicitly warns that the same program can sometimes start twice even with one completion, parallelism one, and Never.

Audit retries in the HTTP client, gateway, worker wrapper, and manual recovery tools. A Job that processes 500 items can send 500 model requests without retrying anything. Set a per-occurrence item limit and attempt allowance in the worker; do not derive them from Pod count.

Claim one occurrence before purchasing generation

Require every worker, including manual and cross-cluster workers, to use the same durable occurrence registry and budget authority. The following is application pseudocode, not a Kubernetes feature:

resolve and validate workload, intended instant, and immutable bindings
atomically insert the unique occurrence, or read its existing state
if complete: return the recorded result
if claimed or outcome uncertain: return existing state; do not send
if ineligible, expired, or over budget: record the decision; do not send
atomically reserve the admitted attempt and change ready -> claimed
only the invocation receiving the confirmed new claim may continue
recheck dispatch eligibility; hand off through the controlled adapter
persist captured usage and settle once, without regenerating on save failure

Implement uniqueness and the state transition in durable storage, with the financial reservation in the same admission transaction. Use the existing atomic budget reservation design for the shared financial invariant. A process-local mutex cannot coordinate replacement Pods or another cluster.

The occurrence claim must be single-use. Reading a stored owner token does not grant another send. A lost admission response also prevents sending: look up the same identity and reconcile it without creating a new claim. A lease expiry must not reset a claimed occurrence to ready automatically: the prior worker might already have sent, or might resume later. Prevent stale dispatch and resolve the original attempt before authorizing a replacement. This design deliberately holds uncertain work rather than claiming exactly-once delivery to an external API.

For reports requiring several calls, give each approved item or stage its own durable identity and attempt allowance beneath the occurrence. Saving a partial report must not cause the next worker to repeat every completed generation.

Budget admitted work and reconcile actual usage

CometAPI’s pre-call cost guide combines the selected model’s prices with input size, output limits, or task counts. It directs readers to actual usage and billing records after completion. Apply those inputs to every permitted attempt, including approved reruns and retries.

A nominal daily forecast is:

scheduled_occurrences × items_per_occurrence × attempts_per_item
× estimated_cost_per_attempt

This forecasts a defined plan; it does not enforce it. Suppose a report runs every 15 minutes, processes 20 items, and makes one attempt per item at a hypothetical average cost of $0.002. The plan is 96 occurrences, 1,920 attempts, and $3.84 per day. If four occurrences each purchase a second full generation, the extra 80 attempts add an illustrative $0.16, for $4.00 total.

These are arithmetic examples, not CometAPI prices or measured savings. Add any other billable operations and infrastructure costs separately. Reserve verified upper bounds for covered charges when claiming a monetary ceiling. An average-cost forecast or character-count token estimate cannot supply that guarantee.

Record occurrence, item and attempt identities; claim decisions; Job and Pod UIDs; price revision; reported usage; calculated cost; and reconciliation state. Keep credentials and report contents out of routine cost events. A Pod timeout, Replace policy, or deleted Job does not prove the request was free. Retain unresolved exposure until evidence supports settlement or release.

Smoke-test workflow

Use a counted fake model adapter with no usable provider credential. Exercise actual durable state transitions and the deployed worker composition. These are checks to perform, not reported results:

ScenarioRequired observation
Two Job UIDs represent the same occurrenceOne confirmed claim and one fake call in the single-item fixture
Two clusters submit the same workload and instantShared registry admits only one initial attempt
Duplicate binding uses a different prompt revisionControlled conflict; no fresh automatic generation
Job starts late or waits beyond report usefulnessFinal eligibility check prevents handoff
Worker stops before or after possible transmissionOriginal attempt remains held; replacement does not blindly send
Result persistence fails after generationCaptured result is retried through storage only
CronJob resumes after suspensionObserved recovery matches deployed-version policy and passes admission
New template lowers limits while an old Job runsOld execution remains accounted for; new policy is not assumed retroactive
Manual rerun or multi-item resume occursExplicit authorization and durable item state prevent unrestricted replay

Verify both controller behavior and the adapter count. A fake scheduler alone does not establish Kubernetes recovery semantics. Before unsuspending production, review active Jobs, unresolved attempts, eligible occurrence age, and remaining allowance. During a cost incident, suspending the CronJob must be paired with a dispatch hold and inspection of existing workers.

Failure modes

Forbid is treated as a global budget lock. A second CronJob or cluster has its own execution scope. Use shared application admission for all workers spending the allowance.

Replace is treated as a refund. Replacing a running Job changes cluster execution. Preserve its transmitted attempts and their financial state before admitting replacement work.

Job history is used as the cost ledger. History limits govern retained Job objects. Persist occurrence and attempt evidence independently so cleanup cannot erase unresolved exposure.

Every Pod chooses a new occurrence timestamp. Duplicate execution becomes apparently new business work. Use the validated intended instant, with an explicit policy for manual work.

Lowering retries is treated as a complete fix. Duplicate starts and application loops remain possible. Enforce occurrence, item, and attempt limits at the controlled adapter boundary.

Sources checked

Three distinct primary public references were retrieved successfully on November 13, 2026 UTC, November 14 in Asia/Shanghai:

  • Kubernetes: CronJob — overlap policy, creation deadlines, suspension, current missed-schedule behavior, time zones, duplicate Jobs, and the scheduled-timestamp annotation. The page displays an October 31, 2026 modification date.
  • Kubernetes: Jobs — worker restarts, duplicate program starts, backoff limits, and active deadlines. The page displays an October 12, 2026 modification date.
  • CometAPI: Estimate request cost before calling a model — model-specific billing units, output controls, and estimate-versus-actual reconciliation.

These maintained technical references support an evergreen integration task. They do not establish a new feature release or a current price. The occurrence registry, financial admission sequence, worked example, and acceptance matrix are recommendations derived from their documented boundaries.

FAQ

Is backoffLimit: 0 a one-call limit?

It disables the normal Job failed-Pod retry allowance. It does not limit the number of calls inside a worker, client retries, or duplicate executions. Enforce those limits in the application.

Should all missed reports be discarded?

That depends on their business purpose. A current dashboard summary may lose value quickly; required historical processing may need completion. Give catch-up work an explicit policy and budget rather than assuming the controller implements the business rule.

Can the Job scheduled-timestamp annotation be used as a provider idempotency key?

It supplies scheduling metadata. It does not establish upstream duplicate suppression. Use it as validated input to the application occurrence identity; rely on provider idempotency only when the exact endpoint documents suitable semantics.

Does suspending the CronJob immediately stop spending?

It stops future starts by that CronJob. Existing Jobs, other schedulers, and already transmitted requests need separate handling. Block new application dispatch and reconcile existing attempts.

Reader next step

Choose one recurring report and trace its intended instant through Job creation, worker startup, and model dispatch. Implement the duplicate-Job fixture against the durable occurrence claim, then verify late-start rejection and storage-only result recovery.

When those checks pass, Start with CometAPI for one approved bounded integration check. Reconcile its attempt and usage before enabling the recurring schedule.