Coder Social home page Coder Social logo

tsung-in-kubernetes's Introduction

Running Tsung in Kubernetes

This project demonstrate one possible way to run Tsung in Kubernetes using StatefulSet.

About Tsung

Tsung is an open-source multi-protocol distributed load testing tool written in Erlang. With proper setup, Tsung could generate millions of virtual users accessing target endpoints.

Typically we run Tsung in baremetal machines or virtual machines. In order to launch Tsung in Kubernetes, we have to figure out a way to assign hostnames to Tsung pods because Tsung master have to connect to slaves using their hostnames.

About StatefulSet

StatefulSet is a beta feature added to Kubernetes in 1.5. It is a controller used to provide unique identity to its Pods. Together with a headless service, we could assign dns name to each pods in the StatefulSet.

Demo

Here is a quick demo showing the process to launch a load test using Tsung in Kubernetes. You could modify tsung-config.yaml to test your own systems.

Create Namespace

$ kubectl create namespace tsung

Launch test target

We use nginx as a demo target

$ kubectl create -f target.yaml --namespace tsung

Set Tsung config

We will inject Tsung config to master pod using ConfigMap. Modify the settings if you like.

$ kubeclt create -f tsung-config.yaml --namespace tsung

Launch Tsung slave

$ kubectl create -f tsung-slave.yaml --namespace tsung

Launch Tsung master

Tsung master will begin the test as soon as the Pod boots up. When the test ended, the master process will keep running so that user could access the test report using Tsung web interface.

$ kubectl create -f tsung-slave.yaml --namespace tsung

Access Tsung web interface

$ kubectl port-forward tsung-master-0 -n tsung 8091:8091

Then we could access the web interface at http://localhost:8091

Cleanup

$ kubectl delete namespace tsung

tsung-in-kubernetes's People

Contributors

adieu avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.