Ferrix is a high-performance reverse proxy and load balancer designed specifically for Kubernetes environments. Built on top of Cloudflare's Pingora framework, it provides efficient HTTP routing and load balancing capabilities while seamlessly integrating with Kubernetes through Custom Resource Definitions (CRDs).
- High-performance HTTP routing powered by Pingora
- Native Kubernetes integration via custom IngressRoute resources
- Dynamic configuration updates through Kubernetes API watches
- Round-robin load balancing
- Support for TLS termination
- Efficient memory management and low latency
- Simple and declarative configuration
Ferrix consists of two main components:
The proxy server handles incoming HTTP traffic and routes it to the appropriate backend services. It leverages Pingora's high-performance networking stack and provides:
- HTTP/1.1 and HTTP/2 support
- Efficient connection pooling
- Request routing based on host and path matching
- Load balancing across multiple backend instances
The Kubernetes controller watches for IngressRoute resources and dynamically updates the proxy's routing configuration. It:
- Monitors the Kubernetes API for changes to IngressRoute resources
- Maintains the routing table in real-time
- Handles service discovery and endpoint updates
- Manages TLS certificate configuration
- First, install the Custom Resource Definition for IngressRoute:
kubectl apply -f crds/k8s/ingressroute.yaml
- Deploy Ferrix using the provided manifest:
kubectl apply -f deploy/ferrix.yaml
Ferrix uses IngressRoute CRDs to define routing rules. Here's an example:
apiVersion: ferrix.com/v1
kind: IngressRoute
metadata:
name: example-route
namespace: default
spec:
entrypoint: web
route:
host: example.com
rules:
- matches: Path(`/api`)
service:
name: api-service
port: 8080
tls: default-tls
The proxy server is configured through a YAML file:
entry_points:
- name: web
port: 6190
secure: false
server:
threads: 1
Ferrix is written in Rust and uses several key dependencies:
- Pingora: High-performance HTTP proxy framework
- kube-rs: Kubernetes client and controller runtime
- tokio: Asynchronous runtime
- clap: Command line argument parsing
To build the project:
cargo build --release
Run tests:
cargo test
Ferrix is designed for high performance:
- Zero-copy networking when possible
- Efficient connection pooling
- Minimal memory allocations
- Lock-free data structures for concurrent access
- Asynchronous I/O throughout the stack
Contributions are welcome! Please feel free to submit pull requests. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the terms of the LICENSE file
This project is under active development. While it's functional, it should be considered beta software. The API and configuration format may change as we gather more real-world usage feedback.