Skip to content

Commit 6e69af7

Browse files
committed
k6-operator: switch to TestRun CRD instead of K6 CRD
1 parent 0cb25f0 commit 6e69af7

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/data/markdown/translated-guides/en/07 Testing Guides/05 Running distributed tests.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ For scenarios such as these, we've created the [k6-operator](https://github.com/
1717
[k6-operator](https://github.com/grafana/k6-operator) is an implementation of the [operator pattern](/misc/glossary/#operator-pattern) in Kubernetes, defining [custom resources](/misc/glossary/#custom-resource) in Kubernetes.
1818
The intent is to automate tasks that a _human operator_ would normally do; tasks like provisioning new application components, changing configurations, or resolving run-time issues.
1919

20-
The k6-operator defines the custom `K6` resource type and listens for changes to, or creation of, `K6` objects.
21-
Each `K6` object references a k6 test script, configures the environment, and specifies the number of instances, as `parallelism`, for a test run.
20+
The k6-operator defines the custom `TestRun` resource type and listens for changes to, or creation of, `TestRun` objects.
21+
Each `TestRun` object references a k6 test script, configures the environment, and specifies the number of instances, as `parallelism`, for a test run.
2222
Once a change is detected, the operator will react by modifying the cluster state, spinning up k6 test jobs as needed.
2323

2424
## Get started with k6-operator
@@ -181,15 +181,15 @@ When using a `PersistentVolume`, the operator will expect all test scripts to be
181181
To learn more about creating `PersistentVolume` and `PersistentVolumeClaim` resources, review the [Kubernetes documentation](https://kubernetes.io/docs/concepts/storage/persistent-volumes/).
182182

183183
## 4. Create a custom resource
184-
During [installation](#install-the-operator), the `K6` [Custom Resource definition](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) was added to the Kubernetes API.
185-
The data we provide in the custom resource `K6` object should contain all the information necessary for the k6-operator to start a distributed load test.
184+
During [installation](#install-the-operator), the `TestRun` [Custom Resource definition](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) was added to the Kubernetes API.
185+
The data we provide in the custom resource `TestRun` object should contain all the information necessary for the k6-operator to start a distributed load test.
186186

187-
Specifically, the main elements defined within the `K6` object relate to the name and location of the test script to run, and the amount of [parallelism](/misc/glossary/#parallelism) to utilize.
187+
Specifically, the main elements defined within the `TestRun` object relate to the name and location of the test script to run, and the amount of [parallelism](/misc/glossary/#parallelism) to utilize.
188188

189189
<Blockquote mod="note" title="">
190190

191-
The `K6` custom resource provides many configuration options to control the initialization and execution of tests.
192-
For the full listing of possible options, please refer to the project [source](https://github.com/grafana/k6-operator/blob/main/config/crd/bases/k6.io_k6s.yaml) and [README](https://github.com/grafana/k6-operator/blob/main/README.md).
191+
The `TestRun` custom resource provides many configuration options to control the initialization and execution of tests.
192+
For the full listing of possible options, please refer to the project [source](https://github.com/grafana/k6-operator/blob/main/config/crd/bases/k6.io_testruns.yaml) and [README](https://github.com/grafana/k6-operator/blob/main/README.md).
193193

194194
</Blockquote>
195195

@@ -205,7 +205,7 @@ Let's create the file `run-k6-from-configmap.yaml` with the following content:
205205

206206
```yaml
207207
apiVersion: k6.io/v1alpha1
208-
kind: K6
208+
kind: TestRun
209209
metadata:
210210
name: run-k6-from-configmap
211211
spec:
@@ -241,7 +241,7 @@ Assume we've created a `PersistentVolumeClaim` named `my-volume-claim` against a
241241

242242
```yaml
243243
apiVersion: k6.io/v1alpha1
244-
kind: K6
244+
kind: TestRun
245245
metadata:
246246
name: run-k6-from-volume
247247
spec:
@@ -267,13 +267,13 @@ Well written scripts will allow for variability to support multiple scenarios an
267267
These could be anything from passwords to target urls, in addition to system options.
268268

269269
We can pass this data as [environment variables](/misc/glossary/#environment-variables) for use with each pod executing your script.
270-
This can be defined explicitly within the `K6` resource, or by referencing a `ConfigMap` or `Secret`.
270+
This can be defined explicitly within the `TestRun` resource, or by referencing a `ConfigMap` or `Secret`.
271271

272272
<CodeGroup labels={["run-k6-with-vars.yaml"]} lineNumbers={[]} showCopyButton={[true]}>
273273

274274
```yaml
275275
apiVersion: k6.io/v1alpha1
276-
kind: K6
276+
kind: TestRun
277277
metadata:
278278
name: run-k6-with-vars
279279
spec:
@@ -318,7 +318,7 @@ Specifying options via command-line can still be accomplished when using the ope
318318

319319
```yaml
320320
apiVersion: k6.io/v1alpha1
321-
kind: K6
321+
kind: TestRun
322322
metadata:
323323
name: run-k6-with-args
324324
spec:
@@ -342,7 +342,7 @@ Be sure to visit the [options reference](https://k6.io/docs/using-k6/k6-options/
342342
343343
## 5. Run your test
344344
345-
Tests are executed by applying the custom resource `K6` to a cluster where the operator is running.
345+
Tests are executed by applying the custom resource `TestRun` to a cluster where the operator is running.
346346
The test configuration is applied as in the following:
347347

348348
```shell
@@ -362,7 +362,7 @@ If you make use of [real-time results output](/results-output/real-time/), e.g.
362362

363363
```yaml
364364
apiVersion: k6.io/v1alpha1
365-
kind: K6
365+
kind: TestRun
366366
metadata:
367367
name: run-k6-with-realtime
368368
spec:

0 commit comments

Comments
 (0)