Main Configuration File
Thekrakend.json file is the main configuration file for KrakenD. It defines the API gateway’s behavior, endpoints, backends, and all integrations.
Location
The configuration file is located at:Auto-Reload Feature
When you change thekrakend.json file in the playground, the changes are applied automatically without needing to restart the gateway.
Structure Overview
The main configuration file follows the KrakenD v3 schema and contains these top-level properties:Key Properties
| Property | Type | Description |
|---|---|---|
version | number | KrakenD configuration version (currently 3) |
name | string | Descriptive name for your gateway |
port | number | Port where KrakenD listens (default: 8080) |
host | array | Default backend hosts for endpoints |
timeout | string | Global timeout for backend requests |
cache_ttl | string | Default cache time-to-live for responses |
endpoints | array | List of API endpoints exposed by the gateway |
sequential_start | boolean | Whether to start services sequentially |
async_agent | array | Configuration for async message consumers |
extra_config | object | Additional modules (CORS, logging, metrics, etc.) |
Global Extra Config
Theextra_config section at the root level configures gateway-wide features:
Security (CORS)
Telemetry
The playground includes several telemetry integrations:- Metrics: Prometheus-compatible metrics on port 8090
- Logging: Debug-level logging with custom prefix
- Tracing: OpenCensus/Jaeger integration for distributed tracing
- InfluxDB: Time-series metrics storage
- GELF: Log forwarding to Logstash
Editing with KrakenD Designer
The easiest way to editkrakend.json is by using the KrakenD Designer:
- Drag and drop your
krakend.jsonfile to the Designer - Make changes using the visual interface
- Download the edited file
- Replace
config/krakend/krakend.jsonwith the downloaded file - The changes will be applied automatically
Basic Example
Here’s a minimal configuration example:Next Steps
- Learn about endpoint configuration
- Explore flexible configuration with templates
- Configure environment-specific settings