_____
/ ____|
| | __ ___ _ __ ___ __ _
| | |_ |/ _ \| '_ ` _ \ / _` |
| |__| | (_) | | | | | | (_| |
\_____|\___/|_| |_| |_|\__,_|
Goma Gateway is a lightweight High-Performance Declarative API Gateway Management.
Architecture:
It's designed to be straightforward and efficient, offering a rich set of features, including:
-
RESTful API Gateway Management
Simplify the management of your API Gateway with powerful tools. -
Domain/Host-Based Request Routing
Route requests based on specific domains or hosts. -
Multi-Domain Request Routing
Handle requests across multiple domains seamlessly. -
Reverse Proxy
Efficiently forward client requests to backend servers. -
WebSocket Proxy
Enable real-time communication via WebSocket support.
-
Cross-Origin Resource Sharing (CORS)
Define and manage cross-origin policies for secure interactions. -
Custom Headers
Add and modify headers to meet specific requirements. -
Backend Errors Interceptor
Catch and handle backend errors effectively. -
Block Common Exploits Middleware
- Detect patterns indicating SQL injection attempts.
- Identify basic cross-site scripting (XSS) attempts.
-
Authentication Middleware
- Support for ForwardAuth with client authorization based on request results.
- Basic-Auth and OAuth authentication mechanisms.
-
Access Policy Middleware
- Control route access by either
allowing
ordenying
requests based on defined rules.
- Control route access by either
-
Regex Support for URL Rewriting
- Rewrite URL paths using regex patterns.
-
Bot Detection Middleware
- Protect your route from bots by blocking requests from known bots.
-
Logging
Comprehensive request and response logging. -
Metrics
Gather insights and monitor performance metrics. -
Rate Limiting
- In-Memory Rate Limiting: Client IP-based request throttling.
- Distributed Rate Limiting: Leverage Redis for scalable, client IP-based rate limits.
-
Load Balancing
Use a round-robin algorithm for efficient load distribution.
-
Support for Multiple Route and Middleware Configuration Files
Organize routes across multiple.yml
or.yaml
files. -
Support dynamic configuration reload
- Reload configuration without restarting the server.
- Enable or disable routes dynamically, with zero downtime.
-
TLS Support
Ensure secure communication with TLS integration. -
HTTP Method Restrictions
Limit HTTP methods for specific routes to enhance control. -
Configure using K8s Custom Resource Definitions (CRD)
- Kubernetes operator-focused CRDs (gateway, route, and middleware configuration)
- Define your gateways, routes, and middleware directly in code for seamless configuration.
Declarative API Gateway Management, define your routes and middleware directly in code for seamless configuration.
Generate a configuration file using the following command:
docker run --rm --name goma-gateway \
-v "${PWD}/config:/etc/goma/" \
jkaninda/goma-gateway config init --output /etc/goma/config.yml
If no file is provided, a default configuration is created at /etc/goma/goma.yml.
Check your configuration file for errors:
docker run --rm --name goma-gateway \
-v "${PWD}/config:/etc/goma/" \
-p 8080:8080 \
jkaninda/goma-gateway config check --config /etc/goma/config.yml
docker run --rm --name goma-gateway \
-v "${PWD}/config:/etc/goma/" \
-p 8080:8080 \
jkaninda/goma-gateway server --config /etc/goma/config.yml
Goma Gateway provides the following health check endpoints:
- Gateway Health:
/readyz
/healthz
- Routes Health:
/healthz/routes
Here’s an example of deploying Goma Gateway using Docker Compose:
services:
goma-gateway:
image: jkaninda/goma-gateway
command: server
ports:
- "8080:8080"
- "8443:8443"
volumes:
- ./config:/etc/goma/
- Linux
- MacOS
- Windows
Please download the binary from the release page.
Init configs:
./goma config init --output config.yml
To run
./goma server --config config.yml
- Docker
- Kubernetes
The Goma Gateway project welcomes all contributors. We appreciate your help!
If you like or are using Goma Gateway, please give it a star. Thanks!
Please share.
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Copyright (c) 2024 Jonas Kaninda