ITNEXT

ITNEXT is a platform for IT developers & software engineers to share knowledge, connect, collaborate, learn and experience next-gen technologies.

Follow publication

How to run distributed performance tests in Kubernetes with K6

Javier Ramos
ITNEXT
Published in
11 min readJan 9, 2023

--

If you love writing high performant code and also love the power of Kubernetes, I think you are going to find interesting this article where I will explore K6, an open source easy-to-use load testing framework which has the best support for Kubernetes. In this article, I will show you how to perform load testing natively on a Kubernetes cluster using multiple pods simulating real world traffic to test a ElasticSearch cluster deployed using the ECK Operator.

Photo by Marc-Olivier Jodoin on Unsplash

This is a hands-on article where we are going to test the performance of ElasticSearch. You can find the source code of this article in this repo.

What is K6?

K6 is part of Grafana Labs, and it is a free open source tool to perform load testing. It uses JavaScript to easily write test cases and provides many customizations to run the test cases; including running them on Kubernetes. The test results can be easily exported to many places like cloud storage, Prometheus, Datadog and common formats such as CSV and JSON. k6 is free, developer-centric, and extensible.

Using k6, you can test the reliability and performance of your systems and catch performance regressions and problems earlier. k6 will help you to build resilient and performant applications that scale.

K6 follows the Load Testing Manifesto:

K6 can be used by developers, QA engineers or SREs for a wide range of use cases including:

  • Load Testing: K6 is easy to use and uses very little resources. It is designed for running high load tests and includes features such as spike, stress and soak tests.
  • Browser Testing: Using xk6-browser.
  • Chaos Testing: K6 can simulate traffic and inject different types of faults in Kubernetes with xk6-disruptor.
  • Performance Monitoring: With k6, you can automate and schedule to trigger tests very frequently with a small load to…

--

--

Published in ITNEXT

ITNEXT is a platform for IT developers & software engineers to share knowledge, connect, collaborate, learn and experience next-gen technologies.

Written by Javier Ramos

Certified Java Architect/AWS/GCP/Azure/K8s: Microservices/Docker/Kubernetes, AWS/Serverless/BigData, Kafka/Akka/Spark/AI, JS/React/Angular/PWA @JavierRamosRod

Responses (1)

Write a response