CronJobs

You have work that needs to run on a schedule rather than continuously — a
nightly database cleanup, a report, a data sync. On the platform that is a
CronJob Component, created from the Catalog in SVIEW and managed there like
any other Component.

Almost everything you need is self-service in SVIEW. Direct cluster access is
only needed for one thing: triggering a run by hand.

What you can do in SVIEW

TaskWhere
Create a scheduled jobAdd Component → CronJob in the Catalog
Change the schedule, image, or environment variablesThe Component's configuration
Pause a job without deleting itThe Component's configuration
Adjust the job's CPU and memoryThe Component's configuration
Read recent job outputThe Component's Logs tab

Creating a CronJob

  1. In SVIEW, open the Service where the job belongs.
  2. Click Add Component and select CronJob from the Catalog.
  3. Configure it, including:
    • schedule — a standard cron expression, for example 0 2 * * * for daily
      at 02:00 UTC
    • image — your container image and tag
    • any environment variables the job needs
  4. Click Save. The job is deployed and runs automatically on schedule.

Default settings

These apply unless you override them in the Component's configuration.

SettingDefaultDescription
successfulJobsHistoryLimit3How many completed job records to keep
failedJobsHistoryLimit1How many failed job records to keep
concurrencyPolicyForbidPrevents a new run starting while one is still going
restartPolicyNeverA failed pod is not restarted in place — the next scheduled run is the retry

How to verify it worked

After saving, confirm the Component reaches a healthy state on its dashboard,
then check the Logs tab after the first scheduled run to confirm the job
produced the output you expect.

If you have Kubernetes namespace access

Triggering a run immediately, outside the schedule, is not available in SVIEW —
it needs kubectl. Skip this section unless you need that.

Prerequisite: request Kubernetes namespace access through Access
Requests
in SVIEW — see
Namespace Access.
Access is temporary and scoped to your namespace.

Log in through Teleport and select your cluster:

tsh login --user <your-email> --proxy https://teleport.manage.cto2b.eu
tsh kube ls
tsh kube login <your-cluster-name>

List the CronJobs in your namespace:

kubectl get cronjobs -n <your-namespace>

Trigger a run:

kubectl create job --from=cronjob/<cronjob-name> -n <your-namespace> <job-run-name>

Watch it:

kubectl get pods -n <your-namespace> | grep <job-run-name>
kubectl logs -f <pod-name> -n <your-namespace>

Clean up the manual run when you are finished. Deleting the job also deletes its
pods:

kubectl delete job <job-run-name> -n <your-namespace>

If you have a dedicated observability stack, job logs are also queryable in
Grafana Loki — see
Observability.

Related articles


Did this page help you?