Skip to content

Commit

Permalink
readme: write up a summary version
Browse files Browse the repository at this point in the history
  • Loading branch information
yorugac committed Jul 11, 2024
1 parent 238da26 commit 9922325
Showing 1 changed file with 23 additions and 37 deletions.
60 changes: 23 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,42 @@

# k6 Operator

`grafana/k6-operator` is a Kubernetes operator for running distributed k6 tests in your cluster.
`grafana/k6-operator` is a Kubernetes operator for running distributed [k6](https://github.com/grafana/k6) tests in your cluster. k6 Operator introduces two CRDs:
- `TestRun` CRD
- `PrivateLoadZone` CRD

Read also the [complete tutorial](https://k6.io/blog/running-distributed-tests-on-k8s/) to learn more about how to use this project.
`TestRun` CRD is a representation of a single k6 test, executed once. `TestRun` has a large support for configuration of different options that allows you to adapt to different Kubernetes setups. Full list of options can be found in [definition itself](https://github.com/grafana/k6-operator/blob/main/config/crd/bases/k6.io_testruns.yaml).

## Setup
`PrivateLoadZone` CRD is a representation of a load zone: this is a k6 term for a set of nodes within a cluster designated for k6 test runs. `PrivateLoadZone` is integrated with [Grafana Cloud k6](https://grafana.com/products/cloud/k6/) and requires a subscription. The guide to set up `PrivateLoadZone` can be found [here](https://grafana.com/docs/grafana-cloud/testing/k6/author-run/set-up-private-load-zones/) and billing details [here](TODO).

REMOVED
Complete documentation for the k6 Operator can be found [here](TODO). Some additional resources:

## Usage
- A guide [Running distributed load tests on Kubernetes](https://grafana.com/blog/2022/06/23/running-distributed-load-tests-on-kubernetes/).
- A guide [Running distributed tests](https://grafana.com/docs/k6/latest/testing-guides/running-distributed-tests/).
- Grafana Office Hours [Load Testing on Kubernetes with k6 Private Load Zones](https://www.youtube.com/watch?v=RXLavQT58YA).

Samples are available in `config/samples` and `e2e/`, both for `TestRun` and for `PrivateLoadZone`.
Common samples are available in `config/samples` and `e2e/`, both for the `TestRun` and for the `PrivateLoadZone`.

REMOVED
## Contributing

## Uninstallation
<!-- TODO: pull out into contributing guide -->

You can remove the all resources created by the operator with bundle:
```bash
curl https://raw.githubusercontent.com/grafana/k6-operator/main/bundle.yaml | kubectl delete -f -
```

Or with `make` command:
```bash
make delete
```

## Developing Locally

### Pre-Requisites
There are many options to have a local Kubernetes cluster for development: any of them can be used for local development of the k6 Operator. One of such options it to create a [kind cluster](https://kind.sigs.k8s.io/docs/user/quick-start/).

- [operator-sdk](https://sdk.operatorframework.io/docs/installation/)
Additionally, you'll need to install the following tooling:
- Golang
- [kustomize](https://kubectl.docs.kubernetes.io/installation/kustomize/)
- [operator-sdk](https://sdk.operatorframework.io/docs/installation/), for complex changes

### Run Tests
To execute unit tests, use these commands:

#### Test Setup

- `make test-setup` (only need to run once)

#### Run Unit Tests

- `make test`
```bash
make test-setup # only need to run once
make test
```

#### Run e2e Tests
To execute e2e test locally:

- [install kind and create a k8s cluster](https://kind.sigs.k8s.io/docs/user/quick-start/) (or create your own dev cluster)
- `make e2e` for kustomize and `make e2e-helm` for helm
- `make e2e` for kustomize and `make e2e-helm` for Helm
- validate tests have been run
- `make e2e-cleanup`

## See also

- [Running distributed k6 tests on Kubernetes](https://k6.io/blog/running-distributed-tests-on-k8s/)

0 comments on commit 9922325

Please sign in to comment.