Skip to content

Commit 15772a4

Browse files
committed
update Readme and examples with TestRun CRD
1 parent 5c25a1e commit 15772a4

7 files changed

+17
-15
lines changed

Diff for: README.md

+11-9
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,18 @@ This method may be more useful for development of k6-operator, depending on spec
3939

4040
### Installing the CRD
4141

42-
The k6 operator includes custom resources called `K6` and `PrivateLoadZone`. These will be automatically installed when you do a
42+
The k6-operator includes custom resources called `TestRun` and `PrivateLoadZone`. These will be automatically installed when you do a
4343
deployment or install a bundle, but in case you want to do it yourself, you may run the command below:
4444

4545
```bash
4646
make install
4747
```
4848

49+
> :warning: `K6` CRD has been substituted with `TestRun` CRD and will be deprecated in the future.
50+
4951
## Usage
5052

51-
Two samples are available in `config/samples`, one for a test script and one for an actual test run.
53+
Samples are available in `config/samples` and `e2e/`, both for `TestRun` and for `PrivateLoadZone`.
5254

5355
### Adding test scripts
5456

@@ -126,14 +128,14 @@ There is a sample avaiable in `config/samples/k6_v1alpha1_k6_with_localfile.yaml
126128

127129
### Executing tests
128130

129-
Tests are executed by applying the custom resource `K6` to a cluster where the operator is running. The properties
131+
Tests are executed by applying the custom resource `TestRun` to a cluster where the operator is running. The properties
130132
of a test run are few, but allow you to control some key aspects of a distributed execution.
131133

132134
```yaml
133135
# k6-resource.yml
134136

135137
apiVersion: k6.io/v1alpha1
136-
kind: K6
138+
kind: TestRun
137139
metadata:
138140
name: k6-sample
139141
spec:
@@ -199,7 +201,7 @@ If you want to use a custom Service Account you'll need to pass it into both the
199201

200202
```yaml
201203
apiVersion: k6.io/v1alpha1
202-
kind: K6
204+
kind: TestRun
203205
metadata:
204206
name: <test-name>
205207
spec:
@@ -311,7 +313,7 @@ The above command will create an archive.tar in your current folder unless `-O`
311313
kubectl create configmap scenarios-test --from-file=archive.tar
312314
```
313315

314-
In case of using an archive it must be additionally specified in your yaml for K6 deployment:
316+
In case of using an archive it must be additionally specified in your yaml for TestRun deployment:
315317

316318
```yaml
317319
# ...
@@ -327,7 +329,7 @@ In other words, `file` option must be the correct entrypoint for `k6 run`.
327329

328330
### Using extensions
329331
By default, the operator will use `grafana/k6:latest` as the container image for the test jobs.
330-
If you want to use [extensions](https://k6.io/docs/extensions/get-started/explore/) built with [xk6](https://github.com/grafana/xk6) you'll need to create your own image and override the `image` property on the `K6` kubernetes resource.
332+
If you want to use [extensions](https://k6.io/docs/extensions/get-started/explore/) built with [xk6](https://github.com/grafana/xk6) you'll need to create your own image and override the `image` property on the `TestRun` kubernetes resource.
331333

332334
For example, create a `Dockerfile` with the following content:
333335

@@ -357,7 +359,7 @@ We can now use it as follows:
357359
# k6-resource-with-extensions.yml
358360
359361
apiVersion: k6.io/v1alpha1
360-
kind: K6
362+
kind: TestRun
361363
metadata:
362364
name: k6-sample-with-extensions
363365
spec:
@@ -409,7 +411,7 @@ rules:
409411
- apiGroups:
410412
- k6.io
411413
resources:
412-
- k6s
414+
- testruns
413415
verbs:
414416
- create
415417
- delete

Diff for: config/samples/k6_v1alpha1_k6_with_localfile.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
apiVersion: k6.io/v1alpha1
3-
kind: K6
3+
kind: TestRun
44
metadata:
55
name: k6-sample
66
spec:

Diff for: config/samples/k6_v1alpha1_k6_with_output.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
apiVersion: k6.io/v1alpha1
3-
kind: K6
3+
kind: TestRun
44
metadata:
55
name: k6-sample
66
spec:

Diff for: config/samples/k6_v1alpha1_k6_with_volumeClaim.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
apiVersion: k6.io/v1alpha1
3-
kind: K6
3+
kind: TestRun
44
metadata:
55
name: k6-sample
66
namespace: load-test

Diff for: e2e/test-initcontainer-volumes.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
apiVersion: k6.io/v1alpha1
3-
kind: K6
3+
kind: TestRun
44
metadata:
55
name: k6-sample-init-container-volume
66
spec:

Diff for: e2e/test-initcontainer.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
apiVersion: k6.io/v1alpha1
3-
kind: K6
3+
kind: TestRun
44
metadata:
55
name: k6-sample-init-container
66
spec:

Diff for: e2e/test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
apiVersion: k6.io/v1alpha1
3-
kind: K6
3+
kind: TestRun
44
metadata:
55
name: k6-sample
66
spec:

0 commit comments

Comments
 (0)