K6 + Keptn Integration?

Hi all, has anyone written a Keptn integration for K6 yet?

Writing a service which means k6 could respond to the sh.keptn.event.test.triggered CloudEvent and therefore use k6 as a Keptn load test tool would be great.

Hello @adamgardnerit! Thanks for creating a new post :slight_smile:

From what I know, no one has written a Keptn k6 integration yet. But we’ve talked a bit about this in the past (cc @simme) and would be something pretty cool to have.

Still, if you can expand a bit on how you use Keptn, and what you would expect from an integration like this one… That would be nice! (that way, anyone wanting to approach this project, can have some data points from the community).

Daniel,

Hi Daniel, Thanks. So Keptn splits the process from the tooling so any tool can subscribe to cloudevents and react. Out of the box, Keptn comes preinstalled with the JMeter service and it’d be nice to switch that out to use k6 instead.

There’s a guide here to write a Keptn service but in essence it boils down to:

  1. Code up your logic and build a container
  2. Deploy your container and a distributor pod. The distributor is the “glue” between Keptn control plane and your k6 pod.
  3. Decide which event(s) you wish to subscribe to (I imagine things like test.triggered).
  4. Whenever Keptn Control Plane issues a test.triggered event, your k6 pod will start executing, do it’s logic then send a test.finished event (with a result) back to the control plane.

If a k6 service existed, using k6 instead of JMeter in any system would be as simple as uninstalling JMeter and installing k6. The adoption potential for k6 is quite large.

Edit: If there is a k6 image already in existance then potentially we could use the job executor service?

Thanks for the write-up!

Yup, we have a Docker image available: https://k6.io/docs/getting-started/installation/#docker.

I gave the job executor service a quick read, and yeah, looks like something like that can work! (at least it is a quick win).