_format_version: "3.0" _transform: true # Service definitions for new architecture services: # Agent Service (NEW - replaces orchestration layer) - name: agent-api url: http://didi-agent:18789 retries: 3 connect_timeout: 120000 write_timeout: 660000 read_timeout: 660000 tags: - agent - analysis # Legacy: Orchestrator API Service (to be removed after migration) - name: orchestrator-api url: http://orchestrationLayer-orchestrator:8000 retries: 5 connect_timeout: 60000 write_timeout: 60000 read_timeout: 60000 tags: - orchestrator - legacy # Legacy: Analysis Service (to be removed after migration) - name: analysis-api url: http://orchestrationLayer-analysis:8004 retries: 3 connect_timeout: 120000 write_timeout: 120000 read_timeout: 120000 tags: - analysis - legacy # didiAI Platform Gateway (external) - disabled, configure via DIDIAI_GATEWAY_URL env var # - name: didiai-platform # url: ${DIDIAI_GATEWAY_URL} # retries: 3 # connect_timeout: 60000 # write_timeout: 60000 # read_timeout: 60000 # tags: # - didiai # - external # Admin Dashboard - name: admin-dashboard url: http://didi-admin:80 retries: 3 connect_timeout: 30000 write_timeout: 30000 read_timeout: 30000 tags: - ui - dashboard # Routes routes: # ============================================ # Agent Service Routes (NEW) # ============================================ # Agent Health Check - name: agent-health service: agent-api paths: - /agent/health strip_path: true methods: - GET # Agent Status (detailed) - name: agent-status service: agent-api paths: - /agent/status strip_path: false methods: - GET # Agent Pipelines List - name: agent-pipelines service: agent-api paths: - /api/pipelines strip_path: false methods: - GET # Agent Analysis (non-streaming) - name: agent-analyze service: agent-api paths: - /api/analyze strip_path: false methods: - POST # Agent Session Status - name: agent-sessions service: agent-api paths: - /api/sessions strip_path: false methods: - GET # Agent File Upload - name: agent-upload service: agent-api paths: - /api/upload strip_path: false methods: - POST # Agent Abort Session - name: agent-abort service: agent-api paths: - /api/abort strip_path: false methods: - POST # ============================================ # Legacy Orchestrator Routes (to be removed) # ============================================ # Orchestrator Routes - name: orchestrator-catalog service: orchestrator-api paths: - /api/v1/catalog strip_path: false methods: - GET - POST - PUT - DELETE - name: orchestrator-pipelines service: orchestrator-api paths: - /api/v1/pipelines strip_path: false methods: - GET - POST - PUT - DELETE - PATCH - name: orchestrator-runs service: orchestrator-api paths: - /api/v1/runs strip_path: false methods: - GET - POST - name: orchestrator-health service: orchestrator-api paths: - /orchestrator/health strip_path: true methods: - GET # Analysis Service Routes - name: analysis-health service: analysis-api paths: - /analysis/health strip_path: true methods: - GET - name: analysis-stats service: analysis-api paths: - /analysis/stats strip_path: true methods: - GET # didiAI Platform Routes (proxied) - disabled, enable when DIDIAI_GATEWAY_URL is configured # - name: didiai-extractors # service: didiai-platform # paths: # - /didiai/extractors # strip_path: true # methods: # - POST # - GET # # - name: didiai-models # service: didiai-platform # paths: # - /didiai/models # strip_path: true # methods: # - POST # - GET # # - name: didiai-discovery # service: didiai-platform # paths: # - /didiai/discovery # strip_path: true # methods: # - GET # Admin Dashboard Routes - name: admin-ui service: admin-dashboard paths: - /admin strip_path: false preserve_host: true - name: admin-api service: admin-dashboard paths: - /admin/api strip_path: false # Global Plugins plugins: # CORS Configuration - name: cors config: origins: - "http://localhost:3000" - "http://localhost:3001" - "http://localhost:8100" - "*" methods: - GET - POST - PUT - DELETE - OPTIONS - PATCH headers: - Accept - Accept-Version - Content-Length - Content-MD5 - Content-Type - Date - Authorization - X-Request-ID exposed_headers: - X-Auth-Token - X-Request-ID credentials: true max_age: 3600 preflight_continue: false # Rate Limiting (Global) - name: rate-limiting config: minute: 100 hour: 2000 day: 10000 policy: local fault_tolerant: true hide_client_headers: false limit_by: consumer # Request ID Tracking - name: correlation-id config: header_name: X-Request-ID generator: uuid echo_downstream: true # Request Size Limiting (100MB for media files) - name: request-size-limiting config: allowed_payload_size: 104857600 size_unit: bytes require_content_length: false # Response Headers - name: response-transformer config: add: headers: - X-Gateway:DIDI-Kong - X-API-Version:2.0 remove: headers: - Server - Via # Consumers for future authentication (consumer_groups not supported in Kong 3.4) consumers: [] # Upstreams for load balancing (prepared for scaling) upstreams: # Agent Service Upstream (NEW) - name: agent-upstream algorithm: round-robin slots: 10000 healthchecks: active: concurrency: 5 healthy: http_statuses: - 200 interval: 10 successes: 2 http_path: /health timeout: 10 type: http unhealthy: http_failures: 3 http_statuses: - 429 - 500 - 503 interval: 10 tcp_failures: 3 timeouts: 3 targets: - target: didi-agent:18789 weight: 100 tags: - agent # Legacy: Orchestrator Upstream - name: orchestrator-upstream algorithm: round-robin slots: 10000 healthchecks: active: concurrency: 10 healthy: http_statuses: - 200 - 302 interval: 5 successes: 3 http_path: /health timeout: 5 type: http unhealthy: http_failures: 3 http_statuses: - 429 - 500 - 503 interval: 5 tcp_failures: 3 timeouts: 3 targets: - target: orchestrationLayer-orchestrator:8000 weight: 100 tags: - orchestrator - legacy - name: analysis-upstream algorithm: least-connections slots: 10000 healthchecks: active: concurrency: 5 healthy: http_statuses: - 200 interval: 10 successes: 2 http_path: /health timeout: 10 type: http unhealthy: http_failures: 5 interval: 10 timeouts: 5 targets: - target: orchestrationLayer-analysis:8004 weight: 100 tags: - analysis