Skip to content

Agent permissions and data

This page describes the agent (version 0.4.0 and newer) as it is built. Nothing here is a promise about future versions: check the version on the Agents page and the agent changelog of the release you run.

  • Watches the CronJobs, Jobs and Pods of the cluster (or of the namespaces you choose) and keeps a trimmed copy in memory.
  • Creates and updates one CronBeat monitor for each CronJob (name, schedule, time zone, suspended or not).
  • Reports when a Job of a CronJob starts, succeeds or fails, with the run time and, for a failure, the reason.
  • Sends a heartbeat every minute, so CronBeat can tell you when the agent itself goes silent.
  • Reads the three cronbeat.dev/... annotations of a CronJob.

It changes nothing in your cluster.

The chart creates a service account with read-only rules, and nothing else:

API group Resources Verbs
batch cronjobs, jobs list, watch
core ("") pods list, watch
  • With no watchNamespaces, these rules are a ClusterRole (the whole cluster).
  • With watchNamespaces set, no cluster-wide permission is created. A Role and RoleBinding exist only in each listed namespace.
  • There is no access to Secrets, ConfigMaps, pod logs, exec, events or nodes, and no get, create, update, patch or delete verb.

Only three kinds of request, over HTTPS to the API address you configured (https://api.cronbeat.dev by default), each with the agent API key as a bearer token.

Request When What it contains
Sync On start, every 5 minutes, and when a CronJob’s schedule, time zone, suspend flag, annotations or concurrency policy change Cluster name and agent version. For every CronJob: namespace, name, UID, schedule, time zone, whether it is suspended, the values of cronbeat.dev/grace and cronbeat.dev/max-runtime if set, its concurrency policy and startingDeadlineSeconds, the time it last scheduled a Job and last succeeded, and how many Jobs were running
Event When a Job starts, succeeds or fails Cluster name, namespace, CronJob name, Job UID, the type (started, succeeded, failed), the time and run time, and for a failure a reason and a short message (at most 500 characters)
Heartbeat Every minute Cluster name, agent version, number of CronJobs watched

The failure reason and message come from Kubernetes itself, not from your application: for example the container state (OOMKilled with its memory limit, an exit code and what common codes mean), the wait reason of a container (ImagePullBackOff, a missing Secret or ConfigMap), the scheduler’s message for an unschedulable pod, or an eviction. Such a message can contain the name of a Secret, a node, a taint or, when an image cannot be pulled, the image reference the kubelet names in its message (for example Back-off pulling image "registry.example.com/team/app:1.4"). It never contains the contents of a Secret or a ConfigMap.

A CronJob with the annotation cronbeat.dev/ignore: "true" is left out completely.

  • The contents of Secrets or ConfigMaps.
  • The image, command, arguments, environment variables and volumes of your pods. The agent does not look at these fields. The only way an image name can reach CronBeat is inside the kubelet’s own failure message described above.
  • Pod logs and the output of your jobs, including the termination message a container writes itself.
  • Anything outside CronJobs, Jobs and Pods, and anything in namespaces you did not allow.
  • Metrics, traces or any data for advertising or analytics. The agent contacts no other address than the CronBeat API.
  • The monitors, with the names and schedules above.
  • For each event: the type, the time, the run time, the user agent cronbeat-agent and a key that prevents duplicates. The IP address of the cluster is not stored with agent events, and no body is stored with them.
  • For a failed run that opens an incident: the reason and message above, kept with the incident.
  • The agent API key is stored only as a hash. The key itself exists in your cluster, in the Secret created by the chart (or in the Secret you name with existingSecret).

History is deleted after the retention period of your plan. Deleting the monitors or your account deletes them too. See the Privacy Policy and the list of Subprocessors.

The chart’s defaults: the container runs as a non-root user (65532), with a read-only root file system, privilege escalation off, all Linux capabilities dropped and the RuntimeDefault seccomp profile. It exposes no Service. The health port (8081) serves only /healthz and /readyz, for the kubelet. Resource defaults are 20 m CPU and 64 MiB memory requested, 200 m and 256 MiB as limits.

  • Keep a CronJob out: cronbeat.dev/ignore: "true".
  • Limit the agent to some namespaces: watchNamespaces, see Several agents in one cluster.
  • Stop it: helm uninstall <release> -n <namespace> removes everything the chart created. Revoking the agent key in the app makes the API refuse the agent (401).