ASLSP (... originally a piece by John Cage that means: As SLow aS Possible ...) is an extremely simple HTTP app written in Go, packaged with Docker, and deployable in Kubernetes.
Originally used for testing Chaos Engineering tests, now a general purpose app that can operate in two modes: client or server.
The client on port 8888 is called: CRAQUE The server on port 9999 is called: BACQUE
Open two terminals. Start up CRAQUE, the client, on the first:
go build aslsp
export BACQUE="http://localhost:9999/fetch"
./aslsp
Start up BACQUE, the server, on the second:
./aslsp -nofetch
- Test the client in a browser at: http://localhost:8888/dt
- In a terminal:
curl localhost:8888/dt
The result will look like (in macOS the IPv6 localhost shows up as the requestor):
DateTime=202406211513
RequestIP=::1
LocalIP=10.10.10.28
The client will fall-back in the case of BACQUE being unavailable. It will respond with HTTP Error Code 418 to indicate: "I'm not supposed to be showing you this, but the server is down so I am." In other words: I am a teapot, not a coffee maker. I know you want coffee, but here's some tea. This is a real response code that can be tracked.
I'm a teapot
DateTime=202406211524
- Test the server in a browser at: http://localhost:9999/fetch
- In a terminal:
curl localhost:9999/fetch
- Prometheus scrape:
curl localhost:9999/metrics
The result will look identical to the client, because this is what the client fetches:
DateTime=202406211513
RequestIP=::1
LocalIP=10.10.10.28
Using kubectl
install these yaml files in order:
aslsp.yaml
(namespace)bacque.yaml
(server should be up first)craque.yaml
(BACQUE is set in the yaml)
- Get the server LoadBalancer address with something like:
kubectl -n aslsp get svc craque
- Test the server in a browser, my local example is: http://198.19.249.2/dt
The result:
>>> curl 198.19.249.2/dt
DateTime=202406212249
RequestIP=192.168.194.20
LocalIP=192.168.194.16
- Shell into one of the
craque
containers. - Test from the commandline:
wget -q -O - http://bacque/fetch
The result will be identical to what the client gets:
/go/src/aslsp # wget -q -O - http://bacque/fetch
DateTime=202406212356
RequestIP=192.168.194.20
LocalIP=192.168.194.15
- Tests
- Can Codefresh do latest?
- Push to internal reg?
- Sync to public aslsp & publish to github via codefresh, using the same code