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.

Cheers!

1 Like

Hi,

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.
https://hub.docker.com/r/mostafamoradian/xk6-kafka

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
metadata:
  name: k6-sample
spec:
  parallelism: 4
  script:
    configMap:
      name: crocodile-stress-test
      file: test.js
######### SPECIFY CUSTOM K6 IMAGE   #######
  runner:
    image: mostafamoradian/xk6-kafka

1 Like