K6-operator installation with xk6-kafka extension

Hi everyone,

I’m new to the load testing and k6-operator. I have the requirement of load testing using k6-operator with xk6-kafka extension. I have installed k6-operator in kubernetes cluster using helm install command. Now I’m not sure about how to install the xk6-kafka extension with this deployment and how to work with it. Can you guys provide me some guide to establish this. I really appreciate your help. Thank you.

Hi @bs3245

Welcome to the community forum :wave:

To work with extensions and the operator, there’s some guidance at GitHub - grafana/k6-operator: An operator for running distributed k6 tests..

To summarize, you’ll have to create a k6 docker image that includes the kafka extension and use that image in the runner.

I hope this helps.


1 Like


Thank you for responding. I actually need the deployment to be done in kubernetes as a part test running. If you could provide some guidance around that it would be helpful.

Hi @bs3245!

You can build all the needed extensions into a custom k6 docker image with xk6 and push that image to an image repository accessible to your Kubernetes cluster (eg.: docker hub) as @eyeveebee suggested
or you can use the official xk6-kafka image if you just need the xk6-kafka extension.

After that, you can specify the custom image in the K6 custom resource yaml file.
E.g.: original: Running distributed k6 tests on Kubernetes

apiVersion: k6.io/v1alpha1
kind: K6
  name: k6-sample
  parallelism: 4
      name: crocodile-stress-test
      file: test.js
######### SPECIFY CUSTOM K6 IMAGE   #######
    image: mostafamoradian/xk6-kafka

1 Like