K6-operator with custom Docker image dont work


I want to use a custom image for the runner’s. I use a minikube setup and a custom build image with xk6-bundler for xk6-influxdb v2. I have created a local Docker image, which I want to use. I have to set the ImagePullPolicy to never in the yaml or Kubernetes won’t use the local image. But when I try that I get an error from the k6-operator-yaml. What can I do?

Error: error validating data: ValidationError(K6.spec.runner): unknown field “imagePullPolicy” in io.k6.v1alpha1.K6.spec.runner;



Hi @MariusB,

You’re right, K6 spec in k6-operator doesn’t support passing imagePullPolicy. Instead it uses default behavior for the pull policy; docs for reference. In case of local images, you can use any non-latest tag to avoid pulling image. I.e. you can tag your k6-influxdb image with some ext tag and specify it in spec:

  image: k6-influxdb:ext

And operator would work with the local image then.

1 Like

Hi @olha ,

Thank you for your answer! Now I can load the influx-db image!
Can you help me again? How can I provide the runners with the environment variables for the influxdb connection? In that case: K6_INFLUXDB_ORGANIZATION: xxx ; K6_INFLUXDB_BUCKET: xxx and K6_INFLUXDB_TOKEN: xxx. I tried to declare them in the test script but this doesnt work.


I assume you continue setting up k6-operator :slightly_smiling_face: In order to pass environment variables to the image, they must be set in the runner spec like this:

   image: ...
        value: "..."

Then the variable can be referenced in k6 script as described here: