Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9eddaaf
chore: add basic structure for k6-operator docs
heitortsergent Apr 18, 2024
4ea406d
chore: hide reference for now
heitortsergent Apr 18, 2024
2f1015b
k6-operator: add main sections from the repo Readme.md
yorugac May 16, 2024
0731380
Add a short introduction to the index page
heitortsergent Jun 3, 2024
835339f
Update install-k6-operator.md
heitortsergent Jun 3, 2024
96b0ecf
Update upgrade-k6-operator.md
heitortsergent Jun 3, 2024
0bd07ec
Update troubleshooting.md
heitortsergent Jun 3, 2024
024875d
Update executing-k6-scripts-with-testrun-crd.md
heitortsergent Jun 3, 2024
fc15830
Update extensions.md
heitortsergent Jun 3, 2024
af61bb4
Update extensions.md
heitortsergent Jun 3, 2024
0bd92fb
Update common-options.md
heitortsergent Jun 3, 2024
66bd188
Update scheduling-tests.md
heitortsergent Jun 3, 2024
5c71c70
k6-operator: fix typos
yorugac Jun 14, 2024
8a7e311
k6-operator: add content for troubleshooting.md
yorugac Jun 14, 2024
9d046ed
chore: replaces instances of k6-operator with k6 Operator
heitortsergent Jul 1, 2024
b8b8104
chore: add uninstall instructions
heitortsergent Jul 1, 2024
1f999ad
chore: hide Upgrade k6 Operator page
heitortsergent Jul 1, 2024
c77a629
chore: add Use the k6 operator with Grafana Cloud k6 page
heitortsergent Jul 1, 2024
1d27807
chore: review troubleshooting doc
heitortsergent Jul 1, 2024
bc80292
chore: update Namespaced deployment heading to Watch namespace
heitortsergent Jul 1, 2024
c079328
Merge branch 'main' into chore/add-plz-docs
heitortsergent Jul 1, 2024
3f08b76
Apply suggestions from code review
heitortsergent Jul 19, 2024
ac060ef
Move docs to next and v0.52.x folders
heitortsergent Jul 19, 2024
6360694
Remove docs from v0.50.x folder
heitortsergent Jul 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update scheduling-tests.md
  • Loading branch information
heitortsergent committed Jun 3, 2024
commit 66bd18848109318e450b5c366209059069e9ae64
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
---
weight: 400
title: Scheduling tests
title: Schedule k6 tests
---

# Scheduling Tests
# Schedule k6 tests

While the k6-operator doesn't support scheduling k6 tests directly, one can schedule tests with the `CronJob` object from Kubernetes directly. The `CronJob` would run on a schedule and execute creation and deletion of `TestRun` object.
While the k6-operator doesn't support scheduling k6 tests directly, you can schedule tests with the `CronJob` object from Kubernetes directly. The `CronJob` would run on a schedule and execute the creation and deletion of the `TestRun` object.

Running these tests requires a little more setup than standalone test run.
Running these tests requires a little more setup than a standalone test run.

## Create a ConfigMap with k6 scripts
## Create a `ConfigMap` with k6 scripts

This step is described in [Executing k6 script with `TestRun` CRD](https://grafana.com/docs/k6/<K6_VERSION>/set-up/set-up-distributed-k6/usage/executing-k6-scripts-with-testrun-crd/).
Refer to [Run k6 scripts with `TestRun` CRD](https://grafana.com/docs/k6/<K6_VERSION>/set-up/set-up-distributed-k6/usage/executing-k6-scripts-with-testrun-crd/) for details on how to create a `ConfigMap` with k6 scripts.

## Create a ConfigMap of the YAML file for the `TestRun` job

## Create a ConfigMap of the yaml for the `TestRun` job
<!-- TODO: add a proper description for default installations: for bundle & Helm -->

When using `make deploy` installation method, add a `configMapGenerator` to the `kustomization.yaml`:
When using the `make deploy` installation method, add a `configMapGenerator` to the `kustomization.yaml`:

```yaml
configMapGenerator:
Expand Down Expand Up @@ -71,7 +71,7 @@ metadata:

## Create a `CronJob`

A `CronJob` can be defined in the following way:
This is an example of how to define a `CronJob` in a YAML file:

```yaml
# snapshotter.yml
Expand All @@ -80,7 +80,7 @@ kind: CronJob
metadata:
name: <test-name>-cron
spec:
schedule: "<cron-schedule>"
schedule: '<cron-schedule>'
concurrencyPolicy: Forbid
jobTemplate:
spec:
Expand All @@ -97,12 +97,10 @@ spec:
- /bin/bash
args:
- -c
- "kubectl delete -f /tmp/<test-name>.yaml; kubectl apply -f /tmp/<test-name>.yaml"
- 'kubectl delete -f /tmp/<test-name>.yaml; kubectl apply -f /tmp/<test-name>.yaml'
restartPolicy: OnFailure
volumes:
- name: k6-yaml
configMap:
name: <test-name>-config
```

{{< section depth=2 >}}