Run Prombench tests in Kubernetes In Docker.
Follow the KIND installation guide to install KIND on your system.
- Navigate to the
infra/
directory:cd infra/
- Build the Infra CLI tool:
go build .
- Navigate to the
prombench/
directory:cd ../prombench/
- Set the necessary environment variables:
export CLUSTER_NAME=prombench export PR_NUMBER=<PR to benchmark against the selected $RELEASE>
- Deploy the cluster:
../infra/infra kind cluster create -v PR_NUMBER:$PR_NUMBER -v CLUSTER_NAME:$CLUSTER_NAME \ -f manifests/cluster_kind.yaml
- Remove the taint from the
prombench-control-plane
node for deploying the nginx-ingress-controller:kubectl --context kind-$CLUSTER_NAME taint nodes $CLUSTER_NAME-control-plane node-role.kubernetes.io/control-plane-
Collecting, monitoring, and displaying the test results and logs.
If used with the GitHub integration:
-
Login with the Prombot account and generate a new auth token with the following permissions:
public_repo
read:org
write:discussion
-
Set the following environment variables:
export GRAFANA_ADMIN_PASSWORD=password export DOMAIN_NAME=prombench.prometheus.io # Can be set to any other custom domain or an empty string when not used with the Github integration. export OAUTH_TOKEN=<generated token from github or set to an empty string " "> export WH_SECRET=<github webhook secret> export GITHUB_ORG=prometheus export GITHUB_REPO=prometheus export SERVICEACCOUNT_CLIENT_EMAIL=<Your Email address>
-
Deploy the nginx-ingress-controller, Prometheus-Meta, Loki, Grafana, Alertmanager & Github Notifier:
../infra/infra kind resource apply -v CLUSTER_NAME:$CLUSTER_NAME -v DOMAIN_NAME:$DOMAIN_NAME \ -v GRAFANA_ADMIN_PASSWORD:$GRAFANA_ADMIN_PASSWORD \ -v OAUTH_TOKEN="$(printf $OAUTH_TOKEN | base64 -w 0)" \ -v WH_SECRET="$(printf $WH_SECRET | base64 -w 0)" \ -v GITHUB_ORG:$GITHUB_ORG -v GITHUB_REPO:$GITHUB_REPO \ -v SERVICEACCOUNT_CLIENT_EMAIL:$SERVICEACCOUNT_CLIENT_EMAIL \ -f manifests/cluster-infra
-
Set the
NODE_NAME
,INTERNAL_IP
, andNODE_PORT
environment variables:export NODE_NAME=$(kubectl --context kind-$CLUSTER_NAME get pod -l "app=grafana" -o=jsonpath='{.items[*].spec.nodeName}') export INTERNAL_IP=$(kubectl --context kind-$CLUSTER_NAME get nodes $NODE_NAME -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}') export NODE_PORT=$(kubectl --context kind-$CLUSTER_NAME get -o jsonpath="{.spec.ports[0].nodePort}" services grafana)
-
The services will be accessible at:
echo "Grafana: http://$INTERNAL_IP:$NODE_PORT/grafana" echo "Prometheus: http://$INTERNAL_IP:$NODE_PORT/prometheus-meta" echo "Logs: http://$INTERNAL_IP:$NODE_PORT/grafana/explore" echo "Profiles: http://$INTERNAL_IP:$NODE_PORT/profiles"
-
Set the following environment variables:
export RELEASE=<master/main or any prometheus release(ex: v2.3.0) > export PR_NUMBER=<PR to benchmark against the selected $RELEASE>
-
Deploy the Kubernetes objects:
Note: If you encounter a
too many files open
error caused by promtail, increase the default value of/proc/sys/fs/inotify/max_user_instances
from 128 to 512:sudo sysctl fs.inotify.max_user_instances=512
Tip: When using prombench locally, it is recommended to build all the Docker images of tools under the
tools/
directory. Instructions are available in their respectiveREADME.md
files.../infra/infra kind resource apply -v CLUSTER_NAME:$CLUSTER_NAME \ -v PR_NUMBER:$PR_NUMBER -v RELEASE:$RELEASE -v DOMAIN_NAME:$DOMAIN_NAME \ -v GITHUB_ORG:${GITHUB_ORG} -v GITHUB_REPO:${GITHUB_REPO} \ -f manifests/prombench/benchmark
- To delete the benchmark infrastructure, run:
../infra/infra kind cluster delete -v PR_NUMBER:$PR_NUMBER -v CLUSTER_NAME:$CLUSTER_NAME -f manifests/cluster_kind.yaml