Skip to main content
New to Testkube? Unleash the power of cloud native testing in Kubernetes with Testkube. Get Started >

Scheduling Workflows

Testkube supports a cron-based scheduling mechanism that allows you to run your Test Workflows at desired intervals/times.

Scheduling a Workflow by updating the Workflow Definition

info

Schedules are defined in the Workflow YAML under a spec.events.cronjob property - Read More.

The easiest way to schedule your Workflow is to modify the Workflow definition and add the corresponding spec.events.cronjob property, for example the below workflow will be scheduled to run on a daily basis at 3 am:

kind: TestWorkflow
apiVersion: testworkflows.testkube.io/v1
metadata:
name: distributed-k6-demo
namespace: testkube
spec:
events:
- cronjob:
cron: 0 3 * * *
...
tip

Testkube's schedule data format is the same that is used to define Kubernetes Cron jobs, visit Wikipedia Cron format for details.

Schedule a Workflow from the Testkube Dashboard

You can also schedule a Test Workflow from the Testkube Dashboard under the Workflow Settings/Scheduling Panel:

Workflow Scheduling

This will add the corresponding YAML to the Workflow definition:

Workflow Scheduling Definition

info

The Dashboard will only allow you to manage one schedule, if you want to define multiple schedules, you will have to do this directly in the Workflow Definition.

Scheduling Architecture

Testkube uses the scheduling engine from Kubernetes Cron jobs for scheduling your Workflow Executions. For each schedule, a special cron job is created from this template.

Technically, it is a callback to the Testkube API server method, launching the corresponding Workflow execution. The call is executed using curl command from the image curlimages/curl, please make sure it's available in your Kubernetes cluster.