A simple node.js application to test the load on Kubernetes pod by blocking the CPU.
Simple increase the the value of variable desiredLoadFactor in server.js, you can also set FACTOR
env variable to set desiredLoadFactor.
-
/health
or/healthz
Show the health of the running container -
/blockcpu
External API to block the CPU. The application doesn't block CPU automatically. Request this API to block the CPU and load test. Setloadfactor
query parameter to change the desiredLoadFactor.
The program uses the JavaScript while loop to block the CPU. You can test the load on particular pod by running this container as a sidecar.
docker build .
to build the container.