Public | Automated Build

Last pushed: 7 months ago
Short Description
an api that puts some load on the server and returns hashed passwords
Full Description

Running locally

go run main.go

API?

This thing does just one thing.

Anything sent in the url is considered a "password" and is hashed with bcrypt. This is set to put some load on the box. Responses should take at least ~1s to generate.

Examples:

$ curl http://localhost:8080/hello
{"plain":"hello","hashed":"$2a$15$5mQzwyE40EQaHfBFKH5Ns.M.YDSdlYarXNZzKdW800mTnGzEn5iE."}

$ curl http://localhost:8080/
{"plain":"","hashed":"$2a$15$QuVNFv32QakKmeaYvxcRJ.hud4JE5DTGlUf.3XELEFooh63UBDXhG"}

$ curl http://localhost:8080/hello/i/am/a/password
{"plain":"hello/i/am/a/password","hashed":"$2a$15$8FEa7wkcEthIv1DdGjM8durXa2b9SrHMNy1FufCRWDZ1dHT5b3p5m"}

How to put load on it?

brew install vegeta

echo "GET http://localhost:8001/api/v1/proxy/namespaces/load-demo/services/load-demo-api/" | vegeta attack -duration=300s | tee results.bin | vegeta report

echo "GET http://localhost:8001/api/v1/proxy/namespaces/load-demo/services/load-demo-api/$(echo $RANDOM)" | vegeta attack -duration=600s -rate=5 | tee results.bin | vegeta report

How to ship a new release?

Publish code to github on master and docker hub's automated build service will publish a docker image @ jhgaylor/k8s-load-demo-api. The deployment pulls it from docker's public repository.

How to crank everything up?

Docker Pull Command
Owner
jhgaylor
Source Repository