Hey Benchmark Docker and Kubernetes Example
This repository provides an example of running the Hey benchmark tool inside a Docker container and deploying it as a Kubernetes Job. This allows you to easily conduct load testing against a target endpoint using a containerized Hey benchmark.
Prerequisites
Before using this repository, ensure you have the following prerequisites installed:
- Docker: Install Docker
- Kubernetes: Install Kubernetes
- kubectl: Install kubectl
Usage
Build the Docker image for Hey:
make buildThis will create a Docker image named hey-container:latest based on the provided Dockerfile.
(Optional) If you need to push the Docker image to a container registry, update the push target in the Makefile with your registry details and run:
make pushCustomize the Hey benchmark parameters in the overlays/production/kustomization.yaml file. Adjust the values in the configMapGenerator section to set the desired benchmark parameters.
Deploy the Hey benchmark as a Kubernetes Job using Kustomize. Replace production with the desired environment if needed:
make deploy KUBE_ENV=productionThis will create a Kubernetes Job that runs the Hey benchmark with the specified parameters.
Monitor the progress of the Hey benchmark and check the logs:
make logsAfter the Job completes, you can review the benchmark results in the logs.
Clean up and delete the Kubernetes Job when done:
make cleanCustomizing Parameters
You can customize the Hey benchmark parameters by editing the overlays/production/kustomization.yaml file and adjusting the values in the configMapGenerator section. This allows you to easily conduct different load tests with varying parameters.
Contributing
If you'd like to contribute to this repository or report issues, please create an issue or submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.