roryfig/api-gateway-control-plane

By roryfig

Updated 8 months ago

API Gateway control-plane - High-performance Rust API Gateway

Helm
Image
0

2.7K

roryfig/api-gateway-control-plane repository overview

API Gateway Control Plane

The Control Plane is the administrative API server that manages gateway configuration (routes, upstreams, services, plugins) stored in PostgreSQL.

Quick Start

docker run -d \
  --name api-gateway-control-plane \
  -p 8080:8080 \
  -e APP__DATABASE__URL=postgres://user:pass@host:5432/api_gateway \
  roryfig/api-gateway-control-plane:latest

Image Tags

TagDescription
latestLatest stable release
vX.Y.ZSpecific version (e.g., v1.0.0)
vX.YLatest patch of minor version
vXLatest minor of major version

Dependencies

Required:

  • PostgreSQL 15+

Optional:

  • Redis (distributed rate limiting, plugin storage)
  • RabbitMQ (real-time config propagation)

Environment Variables

Required
VariableDescription
APP__DATABASE__URLPostgreSQL connection string
Server
VariableDefaultDescription
APP__SERVER__HOST0.0.0.0Bind address
APP__SERVER__PORT8080HTTP port
Database
VariableDefaultDescription
APP__DATABASE__MAX_CONNECTIONS10Max pool size
APP__DATABASE__MIN_CONNECTIONS2Min pool size
Authentication
VariableDefaultDescription
APP__AUTH__JWT_SECRET-JWT signing secret
APP__AUTH__JWT_ENABLEDtrueEnable JWT auth
APP__AUTH__API_KEY_ENABLEDtrueEnable API key auth
Logging
VariableDefaultDescription
APP__LOGGING__LEVELinfoLog level
APP__LOGGING__FORMATjsonOutput format
Redis (Optional)
VariableDefaultDescription
APP__REDIS__URL-Redis URL
APP__REDIS__POOL_SIZE10Pool size
RabbitMQ (Optional)
VariableDefaultDescription
APP__RABBITMQ__URL-RabbitMQ URL

YAML Configuration

Mount configuration files for complex setups:

# config/default.yaml
server:
  host: 0.0.0.0
  port: 8080

database:
  max_connections: 20
  min_connections: 5

logging:
  level: info
  format: json

auth:
  jwt_enabled: true
  api_key_enabled: true

rate_limit:
  requests_per_window: 1000
  window_seconds: 60
  distributed: true

redis:
  url: redis://redis:6379

rabbitmq:
  url: amqp://guest:guest@rabbitmq:5672
docker run -d \
  -v $(pwd)/config:/app/config:ro \
  -e APP__DATABASE__URL=postgres://user:pass@host:5432/api_gateway \
  -e APP__AUTH__JWT_SECRET=your-secret \
  -e APP_ENV=production \
  roryfig/api-gateway-control-plane:latest

Docker Compose

version: '3.8'
services:
  postgres:
    image: postgres:15-alpine
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: api_gateway

  control-plane:
    image: roryfig/api-gateway-control-plane:latest
    ports:
      - "8080:8080"
    environment:
      APP__DATABASE__URL: postgres://postgres:postgres@postgres:5432/api_gateway
      APP__AUTH__JWT_SECRET: ${JWT_SECRET}
    depends_on:
      - postgres

Health Check

curl http://localhost:8080/health

API Endpoints

# List upstreams
curl http://localhost:8080/api/v1/upstreams

# Create route
curl -X POST http://localhost:8080/api/v1/routes \
  -H "Content-Type: application/json" \
  -d '{"name": "my-route", "path": "/api/*"}'

Tag summary

Content type

Image

Digest

sha256:9569e6932

Size

52.8 MB

Last updated

8 months ago

docker pull roryfig/api-gateway-control-plane