Simple echoserver
, which dumps HTTP requests.
/
: Dump the HTTP request./health
: Return a 200 status code./status
: Return a random status code, via the?status=random
parameter or a the defined status code via the?status=200
parameter./timeout
: Wait the given amount of time (?timeout=1m
) before returning a 200 status code./headersize
: Returns a 200 status code with a headerX-Header-Size
of the size defined via?size=1024
.
The echoserver
can be built with the following command:
go build
./echoserver
When you are using Docker, you can use the following commands:
docker build -f Dockerfile -t ghcr.io/ricoberger/echoserver:latest .
docker run -it --rm --name echotest -p 8080:8080 ghcr.io/ricoberger/echoserver:latest
To deploy the echoserver
at Kubernetes run the following commands:
kubectl apply -n test -f https://raw.githubusercontent.com/ricoberger/echoserver/main/deploy/ns.yaml
kubectl apply -n test -f https://raw.githubusercontent.com/ricoberger/echoserver/main/deploy/deploy.yaml
kubectl apply -n test -f https://raw.githubusercontent.com/ricoberger/echoserver/main/deploy/svc.yaml
kubectl apply -n test -f https://raw.githubusercontent.com/ricoberger/echoserver/main/deploy/vs.yaml
curl -vvv http://localhost:8080/
curl -vvv http://localhost:8080/status?status=400
curl -vvv http://localhost:8080/timeout?timeout=10s