K6 Disruptor and Kubernetes


I am trying to do some test over the creation of scaleobjects for Keda. I am using extension for Kubernetes and Disruptor as we want to add some delay to the metrics server

the test itself is this one but


what i get as result:

ERRO[0029] GoError: error injecting fault: error invoking agent: command terminated with exit code 1
upstream host cannot be localhost when running in transparent mode

disrupt at reflect.methodValueCall (native)
load at disrupt (file:///home/osboxes/Documents/keda-performance/test-delays.js:107:32(34)) executor=shared-iterations scenario=disrupt source=stacktrace

I have tried with podDisruptor and Service disruptor both with same results :confused:
I guess because we are using kubectl that is “localhost”?

Any idea how could i approach this scenario?


Hey @Avivanco, happy to help you troubleshoot this. Something that could cause this error message is the IP address for the pod you’re trying to disrupt being

Can you share with us the spec of the pod (or pods) you’re trying to disrupt, which I understand they should be the metrics-server pods? The output of kubectl get pod -o yaml pod-name-here should suffice.

Additionally, I unfortunately cannot access https://github.com/MrsDaehin/keda-performance/blob/main/test-delays.js, perhaps the repository is private. If you could upload it somewhere else, e.g. gist.github.com, it would be of great help for troubleshooting as well :slight_smile:

~ Ro

1 Like

Sorry i didn’t realize the fork wasn’t public.

I put it in gist now as public


as i can see the ip of the pods that are even created during the test in the setup are

phase: Running

  • ip:

What i am disrupting is the service that is not a local ip either :sa:

I uploaded the pod, service manifests and the test itself.

Thanks for fast response! :slight_smile:

1 Like

Hi @Avivanco could you please confirm the version of disruptor you are using? You mention you are also using the Kubernetes extension, so I’m guessing you are using a custom k6 build. If this is the case the following command should list the version for all extensions:

k6 version

hi Pablo,

osboxes@osboxes:~/Documents/keda-performance$ ./k6 version
k6 v0.45.0 ((devel), go1.20.5, linux/amd64)
github[.]com/grafana/xk6-disruptor v0.3.3, k6/x/disruptor [js]
github[.]com/grafana/xk6-kubernetes v0.6.0, k6/x/kubernetes [js]
github[.]com/szkiba/xk6-yaml v0.1.3, k6/x/yaml [js]

this is what we are using :slight_smile:

Hi Almudena

We think the error has nothing to do with your setup but with an issue with k6 custom builds that include the xk6-disruptor that mixes the versions of the disruptor extension and the disruptor agent.

As a workaround, we have released version v0.3.4 of the disruptor that should synchronize again the version of these two components.

1 Like

thanks Pablo! :slight_smile:
I have tested the new release and with podDisruptor is working fine but with ServiceDisruptor it gives another error:

ERRO[0026] GoError: error injecting fault: error invoking agent: command terminated with exit code 1
DestinationPort (8080) and RedirectPort (8080) must be different

I tried with port configured in the fault and without. In both scenarios with the same error.


Hi Amudena

The problem is that by default the agent is listening to the port 8080 which is the same port that the pod is listening to. You can use the proxyPort option. Please don’t pay attention to the documentation that states the default is 8000 because it is actually 8080 and we are fixing it

1 Like