Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/k6/next/testing-guides/injecting-faults-with-xk6-disruptor/requirements.md, or by sending Accept: text/markdown to https://grafana.com/docs/k6/next/testing-guides/injecting-faults-with-xk6-disruptor/requirements/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
Requirements
The xk6-disruptor is a k6 extension. To use it in a k6 test script, you need to bundle a k6 extension that includes the disruptor. Refer to the Installation section for instructions on how to get this custom build.
xk6-disruptor needs to interact with the Kubernetes cluster on which the application under test is running.
To do so, you must have the credentials to access the cluster in a kubeconfig file.
Ensure that this file is pointed to by the KUBECONFIG environment variable or that it is located at the default location, $HOME/.kube/config.
Note
xk6-disruptor requires Kubernetes version 1.23 or higher
xk6-disruptor requires the grafana/xk6-disruptor-agent image for injecting the
disruptor agent into the disruption targets. Kubernetes clusters can be configured to restrict the download of images from public repositories. You need to ensure this image is available in the cluster where the application under test is running. Additionally, the xk6-disruptor-agent must run with network access privileges. Kubernetes clusters can be configured to restrict the privileges of containers.
If you find an error similar to the following when using the xk6-disruptor, contact your cluster administrator and request the necessary privileges.
ERROR[0000] error creating PodDisruptor: pods “nginx” is forbidden: violates PodSecurity “baseline:latest”: non-default capabilities (container “xk6-agent” must not include “NET_ADMIN”, “NET_RAW” in securityContext.capabilities.add)
You also need to ensure your test application is accessible from the machine where the tests run. Refer to Expose your application section for instructions on how to make your application available from outside the Kubernetes cluster.
Was this page helpful?
Related resources from Grafana Labs

