---
title: Charmhub | Deploy K6 K8S using Charmhub - The Open Operator Collection
description: Deploy the latest version of K6 K8S as a Kubernetes Operator on any cloud.
url: https://charmhub.io/k6-k8s/libraries/k6_test
---

# K6 K8S

[Luca Bello](https://charmhub.io/publisher/lucabello "View all packages from Luca Bello")

* [Luca Bello](https://charmhub.io/publisher/lucabello "View all packages from Luca Bello")

Platform:

1.7/stable rev11

```
juju deploy k6-k8s --channel 1.7/stable
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

[Toggle side navigation](https://charmhub.io/k6-k8s/libraries/k6_test#drawer)

## charms.k6\_k8s.v0.k6\_test

* [*Docstrings*Docstrings](https://charmhub.io/k6-k8s/libraries/k6_test)
  [*Code*Source code](https://charmhub.io/k6-k8s/libraries/k6_test/source-code)
* + Download

    Fetch library

    ```
    charmcraft fetch-lib charms.k6_k8s.v0.k6_test
    ```

    [Download k6\_test.py](https://charmhub.io/k6-k8s/libraries/k6_test/download)
  + *Last updated* 21 Apr 2026
  + *Revision* Library version 0.1

Charm library to transfer k6 tests.

Charms that need to push load tests to a k6 charm, should use the
`K6TestProvider` class. Charms that run those tests and need to receive them,
should use the `K6TestRequirer` class.

---

Index

* [class K6TestRequirer](https://charmhub.io/k6-k8s/libraries/k6_test#k6testrequirer)
* + [def \_\_init\_\_(
    self,
    charm)](https://charmhub.io/k6-k8s/libraries/k6_test#k6testrequirer-__init__)
* + [def tests(
    self)](https://charmhub.io/k6-k8s/libraries/k6_test#k6testrequirer-tests)
* + [def environment(
    self)](https://charmhub.io/k6-k8s/libraries/k6_test#k6testrequirer-environment)
* [class K6TestProvider](https://charmhub.io/k6-k8s/libraries/k6_test#k6testprovider)
* + [def \_\_init\_\_(
    self,
    charm)](https://charmhub.io/k6-k8s/libraries/k6_test#k6testprovider-__init__)
* + [def k6\_tests(
    self)](https://charmhub.io/k6-k8s/libraries/k6_test#k6testprovider-k6_tests)
* + [def reconcile(
    self)](https://charmhub.io/k6-k8s/libraries/k6_test#k6testprovider-reconcile)

#### class K6TestRequirer

Helper class for the 'receiving' side of k6 tests.

Description

The `K6TestRequirer` object can be instantiated as follows in your charm:

```
def __init__(self, *args):
    ...
    self.k6_tests = K6TestRequirer(self)
    ...
```

The `K6TestRequirer` assumes that, in your charm metadata, you declare a
relation as follows:

```
requires:
    receive-k6-tests:  # Relation name
        interface: k6_tests  # Relation interface
```

Methods

K6TestRequirer.
\_\_init\_\_(

*self*

,
charm: CharmBase
)

K6TestRequirer.
tests(

*self*
)

Get the k6 tests from all relations.

Returns

A dictionary mapping the app name to the tests it provides.

K6TestRequirer.
environment(

*self*
)

Get the k6 tests from all relations.

Returns

A dictionary mapping the app name to the tests it provides.

#### class K6TestProvider

Helper class for the 'sending' side of k6 tests.

Description

The `K6TestProvider` object can be instantiated as follows in your charm:

```
def __init__(self, *args):
    ...
    environment: Dict[str, str] = {"SOME_ENDPOINT": "http://10.1.2.3:1234"}
    self.k6_tests = K6TestProvider(
        self,
        tests_folder="tests/load",
        environment=environment,
    )
    self.k6_tests.reconcile()
    ...
```

The `K6TestProvider` assumes that, in your charm metadata, you declare a
relation as follows:

```
requires:
    send-k6-tests:  # Relation name
        interface: k6_tests  # Relation interface
```

Methods

K6TestProvider.
\_\_init\_\_(

*self*

,
charm: CharmBase
)

K6TestProvider.
k6\_tests(

*self*
)

Description

Read the k6 tests from the folder specified in the constructor. None

K6TestProvider.
reconcile(

*self*
)

Description

Re-generate the world state for the charm library. None
