Skip to content

rubrionmc/wayguard

Repository files navigation

Contributors Forks License GitHub Stars Issues


Logo

Wayguard

A lightweight Go TCP gateway that automatically routes traffic to a healthy backend.

View Demo · Report Bug · Request Feature

Table of Contents

Contents
  1. About The Project
  2. Getting Started
  3. Configuration
  4. Usage
  5. Roadmap
  6. Contributing
  7. License
  8. Contact

About The Project

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.

(back to top)

Getting Started

Follow these steps to run the proxy locally or in a Kubernetes environment.

Prerequisites

  • Go 1.21+ installed
  • Git
  • k8s cluster with API access (k8s, kind, minikube, etc.)
  • Optional: Docker for containerized deployments

Installation

  1. Clone the repository:
git clone https://github.com/rubrionmc/wayguard.git
cd wayguard
  1. Prepare the configuration file config.toml or specify a custom path with -config/-c.

  2. 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
  1. Prepare the configuration file config.toml or specify a custom path with -config/-c.

(back to top)

Usage

Run the proxy with:

./gopolice -config config.toml

Or 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.

Example Logs

comming soon

(back to top)

Roadmap

  • 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

(back to top)


Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create your feature branch (git checkout -b octodex/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing Feature')
  4. Push to the branch (git push origin octodex/amazing-feature)
  5. Open a Pull Request

(back to top)

License

Distributed under the RPL License. See LICENSE for details.

(back to top)

About

Go TCP gateway that automatically routes traffic to a healthy backend.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors