Giter Club home page Giter Club logo

k8s-perf-test-template's Introduction

Kubernetes

Running cluster's dashboard

k8s dashboard repo

# Create pods
kubectl apply -f k8s-dashboard/dashboard.yaml
kubectl apply -f k8s-dashboard/auth.yaml

# Listen on localhost:8001
kubectl proxy

# Generate token
kubectl -n kubernetes-dashboard get secret $(kubectl -n kubernetes-dashboard get sa/admin-user -o jsonpath="{.secrets[0].name}") -o go-template="{{.data.token | base64decode}}"
  • Copy token to notepad
  • Visit dashboard and paste token to log in

Initializing pods

kubectl create -R -f resources/

Grafana

username: admin

password: XhXUdmQ576H6e7

Running test

./run_test.sh -j <filename.jmx> -n <namespace> -c -m -i <slaves_number> -r
# (c) - csv flag
# (m) - flag dedicated for copying test fragment
# (r) - generate report after test

Stopping test

./stop_test.sh

HTML report

# If a master pod is not available, create one
kubectl apply -f resources/jmeter/jmeter-master.yaml
# Wait for the pod is Running, then
kubectl cp -n <namespace> <master-pod-id>:/report/<result_tag> result/<result_tag>
# To copy the content of the report from the pod to your local

Performance test script

You need to put your JMeter project inside the scenario folder, inside a folder named after the JMX (without the extension). Put your CSV file inside the dataset folder, child of scenario Put your JMeter modules (include controllers) inside the module folder, child of scenario

dataset and moduleare in scenario and not below inside the <project> folder because, in some cases, you can have multiple JMeter projects that are sharing the JMeter modules (that's the goal of using modules after all).

Below a visual representation of the file structure

+-- scenario
|   +-- dataset
|   +-- module
|   +-- my-scenario
|       +-- my-scenario.jmx
|       +-- .env

In order to change test parameters, please edit .env file

Deployment

Google Cloud Platform

Prerequisites

Cluster with nodes shall be created on Google Cloud Platform account

Connection with cluster

tutorial

# Get current cluster info
kubectl config current-context
 
# Connect with cluster
gcloud container clusters get-credentials <CLUSTER_NAME>

Grafana

Please visit grafana's service external endpoint and log in using provided credentials.

Minikube (local machine cluster)

Running minikube cluster

minikube start --driver <DRIVER> --memory <RAM_AMOUNT_MB> --cpus <CPUS_NUMBER>
# DRIVER: hyperv, docker

Grafana

# Port forwarding
kubectl port-forward <grafana_pod_id> 3000

Please visit localhost:3000 and log in using provided credentials.

References

Good tutorial

Tutorial repo

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.