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.
Before using this repository, ensure you have the following prerequisites installed:
- Docker: Install Docker
- Kubernetes: Install Kubernetes
- kubectl: Install kubectl
make build
This 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 push
Customize 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=production
This 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 logs
After the Job completes, you can review the benchmark results in the logs. Clean up and delete the Kubernetes Job when done:
make clean
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.
If you'd like to contribute to this repository or report issues, please create an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.