Giter Club home page Giter Club logo

kube-test-container's Introduction

Kubernetes Test Container

This is a very simple container that you can use to test your Kubernetes cluster.

Simply create a deployment and service with the yaml file:

kubectl create -f ./kubernetes/kube-test-container.yaml

The containers have already been uploaded so you don't need to build anything here. But the full source is provided here if you want to extend this (Pull Request welcome).

Scale the deployment

kubectl scale deployment kube-test-container --replicas=30

Automatic scaling

Turn on automatic scaling with HPA

kubectl autoscale deployment kube-test-container --min=10 --max=20

View the status

kubectl get deploy,svc kube-test-container

View the status page and generate load

View the external IP Address using the Load Balancer IP http://IPADDRESS/. You will see the correct address marked as EXTERNAL-IP in the service status (see above).

If you click the "Let one use too much RAM" http://IPADDRESS/ram or "Let one use too much CPU" http://IPADDRESS/cpu to trigger one of the container to use too much RAM / CPU (this will grow unbound).

Click "Fetch multiple status pages" for requesting status http://IPADDRESS/status

External load testing

You can use your favorite benchmarking tool. The simplest for many would be Apache Benchmark:

ab -n 1000 -c 10 http://IPADDRESS/status

Testing upgrades

There are three different versions of this component that only differ in reporting a different version:

  • sverrirab/kube-test-container:v1.0
  • sverrirab/kube-test-container:v1.1
  • sverrirab/kube-test-container:v1.2
kubectl set image deployment/kube-test-container kube-test-container=sverrirab/kube-test-container:v1.1

Cleanup

kubectl delete deploy,svc kube-test-container

Helm installation

For testing your cluster with Helm:

helm repo add kube-test-container https://raw.githubusercontent.com/sverrirab/kube-test-container/master/helm/charts/

To see available versions:

helm search --versions kube-test-container

And to install:

helm install --version 1.1.0 --name ktc kube-test-container/kube-test-container

Screenshot

Screen Shot

Building and testing

If you want to make modifications you can use the ./build.sh script to build a local docker container and ./run.sh to test it locally through http://localhost:8000/.

License

MIT License - read the LICENSE file for details.

kube-test-container's People

Contributors

sverrirab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.