diff --git a/examples/tcp.proxy/README.md b/examples/tcp.proxy/README.md new file mode 100644 index 0000000000..a4764bcd9c --- /dev/null +++ b/examples/tcp.proxy/README.md @@ -0,0 +1,23 @@ +# tcp.proxy + +Listens on tcp port `12345` and will proxy iperf traffic to iperf server. + +## Requirements + +- docker compose + +## Setup + +To `start` the Docker Compose stack defined in the [compose.yaml](compose.yaml) file, use: + +```bash +docker compose up -d +``` + +## Teardown + +To remove any resources created by the Docker Compose stack, use: + +```bash +docker compose down +``` diff --git a/examples/tcp.proxy/compose.yaml b/examples/tcp.proxy/compose.yaml new file mode 100644 index 0000000000..000413f02e --- /dev/null +++ b/examples/tcp.proxy/compose.yaml @@ -0,0 +1,35 @@ +name: ${NAMESPACE:-zilla-tcp-proxy} +services: + iperf-server: + image: networkstatic/iperf3 + container_name: iperf-server + command: -s + ports: + - "5201:5201" + + zilla: + image: ghcr.io/aklivity/zilla::${ZILLA_VERSION:-latest} + restart: unless-stopped + hostname: zilla.examples.dev + ports: + - "12345:12345" + volumes: + - ./etc:/etc/zilla + command: start -v -e -Pzilla.engine.maximum.messages.per.read=10 + healthcheck: + interval: 5s + timeout: 3s + retries: 5 + test: ["CMD", "bash", "-c", "echo -n '' > /dev/tcp/127.0.0.1/12345"] + depends_on: + - iperf-server + + iperf-client: + image: networkstatic/iperf3 + container_name: iperf-client + entrypoint: > + sh -c "sleep 10 && + iperf3 -c zilla.examples.dev -p 12345 -P 50 -t 20" +networks: + default: + driver: bridge diff --git a/examples/tcp.proxy/etc/zilla.yaml b/examples/tcp.proxy/etc/zilla.yaml new file mode 100644 index 0000000000..46e820aa22 --- /dev/null +++ b/examples/tcp.proxy/etc/zilla.yaml @@ -0,0 +1,20 @@ +--- +name: example +bindings: + north_tcp_server: + type: tcp + kind: server + options: + host: 0.0.0.0 + port: 12345 + exit: south_tcp_client + south_tcp_client: + type: tcp + kind: client + options: + host: iperf-server + port: 5201 +telemetry: + exporters: + stdout_logs_exporter: + type: stdout