Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ricoberger/echoserver
Simple echoserver, which dumps HTTP requests.
https://github.com/ricoberger/echoserver
docker echoserver go golang kubernetes
Last synced: 3 months ago
JSON representation
Simple echoserver, which dumps HTTP requests.
- Host: GitHub
- URL: https://github.com/ricoberger/echoserver
- Owner: ricoberger
- License: mit
- Created: 2021-02-25T11:59:17.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-20T07:39:36.000Z (3 months ago)
- Last Synced: 2024-11-05T21:45:10.335Z (3 months ago)
- Topics: docker, echoserver, go, golang, kubernetes
- Language: Go
- Homepage:
- Size: 22.5 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# echoserver
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 header `X-Header-Size` of the size defined via `?size=1024`.## Build
The `echoserver` can be built with the following command:
```sh
go build
./echoserver
```When you are using Docker, you can use the following commands:
```sh
docker build -f Dockerfile -t ghcr.io/ricoberger/echoserver:latest .
docker run -it --rm --name echotest -p 8080:8080 ghcr.io/ricoberger/echoserver:latest
```## Deploy
To deploy the `echoserver` at Kubernetes run the following commands:
```sh
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
```## Exmples
```sh
curl -vvv http://localhost:8080/
curl -vvv http://localhost:8080/status?status=400
curl -vvv http://localhost:8080/timeout?timeout=10s
```