Skip to main content

Configuration

Configure EdgeRun for your environment and deployment needs with flexible YAML configuration

Configuration

YAML Config

EdgeRun uses a flexible YAML-based configuration system that allows you to customize behavior for different environments, providers, and deployment scenarios.

Configuration File Locations

EdgeRun looks for configuration files in the following order (first found is used):

1
./edgerun.yaml(current directory)
2
~/.edgerun/config.yaml(user home)
3
/etc/edgerun/config.yaml(system-wide)

Basic Configuration

When you run edgerun init, a basic configuration file is created:

Default Configuration
# ~/.edgerun/config.yaml
version: "1.0"

# Default provider settings
provider:
  default: "local"
  timeout: 300s

# Authentication settings
auth:
  endpoint: "https://auth.edgerun.tech"
  auto_refresh: true

# Deployment defaults
deployment:
  region: "auto"
  replicas: 1
  health_check: true

Provider Configuration

Configure the local Docker provider for development:

providers:
  local:
    type: "local"
    docker:
      host: "unix:///var/run/docker.sock"
    resources:
      max_cpu: "4"
      max_memory: "8Gi"
      max_storage: "100Gi"

Deployment Configuration

Configure resource limits and requests:

# Global resource limits
resources:
  limits:
    cpu: "4"
    memory: "8Gi"
    storage: "100Gi"
  requests:
    cpu: "100m"
    memory: "128Mi"

# Per-deployment resource limits
deployment:
  resources:
    limits:
      cpu: "1"
      memory: "2Gi"
    requests:
      cpu: "250m"
      memory: "512Mi"

Security Configuration

Configure container security policies:

security:
  container:
    read_only_root_filesystem: true
    run_as_non_root: true
    run_as_user: 65534
    run_as_group: 65534
    drop_capabilities:
      - "ALL"
    add_capabilities:
      - "NET_BIND_SERVICE"
    seccomp_profile:
      type: "RuntimeDefault"
    apparmor_profile: "runtime/default"

Monitoring and Logging

Configure metrics collection and exposure:

monitoring:
  metrics:
    enabled: true
    endpoint: "/metrics"
    port: 9090
    interval: 30s
    
    # Prometheus configuration
    prometheus:
      scrape_configs:
        - job_name: "edgerun-apps"
          static_configs:
            - targets: ["app:9090"]
    
    # Custom metrics
    custom_metrics:
      - name: "business_metric"
        type: "counter"
        help: "Custom business metric"
        labels: ["region", "environment"]

Best Practices

Create separate configuration files for different environments:

project/
├── edgerun.yaml              # Base configuration
├── edgerun.development.yaml  # Development overrides
├── edgerun.staging.yaml      # Staging overrides
└── edgerun.production.yaml   # Production overrides

Use the --config flag to specify which config to use:

edgerun deploy --config edgerun.production.yaml