Hidden gems of Testkube: k6 and Kubernetes

Many times we may need to orchestrate our API, UI and performance tests in different places. This can often be a somewhat challenging process in terms of test management. Especially when we want to manage and monitor different test suites in one place, we have to make complex configurations.

Testkube actually gives us the answer to all these questions. By its own definition, Testkube is a Kubernetes-native testing framework. Testkube allows us to execute and monitor all our functional, performance, and security tests from one place within the Kubernetes cluster. Testkube also allows us to run different test files by fetches from repos. It allows us to manage all testing activities through Testkube, eliminating the complexity in CI/CD processes.

In this article, I will show you how you can make a difference in the world of load testing with TestKube. We will do this using k6 and as you know k6 is one of the most used and most popular load test tools of the last period.

When we want to run our tests with k6 in the Kubernetes environment, we come up with a few options, one of them being the k6-operator developed by k6. If you want, you can perform these operations using the k6-operator, but the process here may lead us to different configurations and complexity. Testkube comes into play here and integrates with k6 in Kubernetes in a very short time and solves all the problems I mentioned above.

You can proceed through the documentation for Testkube installation ( https://kubeshop.github.io/testkube/installing ).

I’m going to do a quick install for Homebrew for macOS.

After installing testkube, we also need to install testkube components on our Kubernetes clusters.

That’s all, we are now ready to run our test on the cluster.

Let’s quickly write a k6 test and witness how easy and developer-friendly k6 is again.

After creating our test, let’s save it as k6-example.js.

After that, it is very easy to leave yourself in the hands of testkube and run your test with two commands.
First of all, you need to define it with “k6/script” type.

After we see that our definition is done as a success, we can now run.

Our test started to run successfully and we can check the logs automatically from where we run it. Apart from this, it also provides us with the commands that we can pull logs in detail after the execution is completed.

Apart from all these details, we can also see the extra logs and results on the dashboard provided by Testkube.

Now you have run your k6 load test with cloud-native way over Kubernetes cluster. Now it’s time to integrate API and UI tests and run them all together. Stay tuned.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store