https://github.com/vshn/k8s-storage-bench
Python utility and container image to benchmark K8s storage classes with `kubestr`
https://github.com/vshn/k8s-storage-bench
Last synced: 5 months ago
JSON representation
Python utility and container image to benchmark K8s storage classes with `kubestr`
- Host: GitHub
- URL: https://github.com/vshn/k8s-storage-bench
- Owner: vshn
- License: bsd-3-clause
- Created: 2021-07-20T07:24:21.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T14:40:10.000Z (over 1 year ago)
- Last Synced: 2024-11-30T20:22:56.393Z (7 months ago)
- Language: Python
- Size: 31.3 KB
- Stars: 4
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Storage Benchmark for K8s
## Prerequisites
* Access to cluster
* [kubestr](https://kubestr.io/)
* Python 3.8
* `matplotlib` for rendering plots of results## Usage
Call `bench.py -s mystorageclass` to run full set of benchmarks for StorageClass `mystorageclass`.
Check `bench.py -h` for available options.
The benchmark script will save the results into JSON file `results_%Y_%m_%d_%H%M%S.json` (Python `strftime` format).You can visualize the results by running `./render.py .json`.
This command will produce a PDF file with plots for the benchmark results.To extract statistical information from a results file, you can run `./data.py `.
This command prints the same statistical information which is printed during the benchmark run.## Local setup
We recommend that you setup a virtualenv to run the scripts locally.
```bash
git clone https://github.com/vshn/k8s-storage-bench.git
cd k8s-storage-bench
python3.8 -m venv .virtualenv
. .virtualenv/bin/activate
pip install -r requirements.txt
# Show help
./bench.py -h
# Run all benchmarks for storage class mystorageclass
./bench.py -s mystorageclass
```## Container image and deploy manifests
The container image is available on quay.io/vshn/k8s-storage-bench.
### Building the container image
The included `Dockerfile` can be used to build a container image based on `python:3.8-slim`.
### Running the benchmark as a K8s job
Adjust `deploy/job.yaml` to customize the benchmark configuration.
If you want to run the benchmark in a namespace other than `default`, adjust the RoleBinding in `deploy/rbac.yaml` accordingly.Then you can execute the provided `run.sh` to run the benchmark with the default settings.