Can we create Kubernetes custom resource (k6-operator) by making use of xk6-Kubernetes extension?


I have a requirement to create k6-operator pods (custom resource) from my k6 script.

So I thought i will make use of xk6-Kubernetes extension but was unable to create them as only limited resources are supported as of now?

Is there a way by which i can apply/create k6-operator pods with the help of manifest files from another k6-script running locally?

Hello @Akshayini!

Enabling access to the K6 resource type (CRD from k6-operator) seems like something that could be added to the xk6-kubernetes extension. Until that can be added, you could use the xk6-exec to directly call the kubectl tool as long as it is installed on the host machine running your script.

I’m hoping that you’re only looking to trigger distributed tests from a local k6 test script and not looking to actually install the CRD. The CRD installation doesn’t feel like a good use-case from a test script.

Thankyou for the update.

Yes, I’m just looking for triggers distributed tests (by creating k6-operator pods) from local k6 script and not installation of it.

I’ll try to use xk6-exec till then.