A lightweight Go TCP gateway that automatically routes traffic to a healthy backend.
View Demo
·
Report Bug
·
Request Feature
Wayguard is a lightweight Go TCP proxy/gateway that:
- Discover healthy backends by there labels and namespace from k8s API.
- Routes traffic to a single selected backend automatically.
- Supports Primary / Fallback backends (e.g., different Pod types in Kubernetes).
- Performs dynamic health checks to detect and switch to healthy backends.
- Fully configurable via a TOML file.
The proxy ensures that only one backend is active at a time while keeping traffic uninterrupted if that one ist crashing.
Follow these steps to run the proxy locally or in a Kubernetes environment.
- Go 1.21+ installed
- Git
- k8s cluster with API access (k8s, kind, minikube, etc.)
- Optional: Docker for containerized deployments
- Clone the repository:
git clone https://github.com/rubrionmc/wayguard.git
cd wayguard-
Prepare the configuration file
config.tomlor specify a custom path with-config/-c. -
Build the proxy:
go mod download
go build -o wayguard .or use the provided Dockerfile to build a container image:
docker build -t wayguard:latest .or use the deploy.sh to deploy the proxy directly to a local Kubernetes cluster:
sh update.sh- Prepare the configuration file
config.tomlor specify a custom path with-config/-c.
Run the proxy with:
./gopolice -config config.tomlOr use the docker image you built
- Logs show backend health and active connections.
- Only one backend is selected at any time.
- Automatically switches to fallback if primary becomes unavailable.
comming soon
- Configurable Primary/Fallback backends
- Health checks and dynamic selected connection
- Lightweight architecture with minimal dependencies
- Kubernetes API integration for automatic Pod discovery
- TLS support
- Metrics endpoint
Contributions are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b octodex/amazing-feature) - Commit your changes (
git commit -m 'Add amazing Feature') - Push to the branch (
git push origin octodex/amazing-feature) - Open a Pull Request
Distributed under the RPL License. See LICENSE for details.