---
kind: Service
name: api
count: 2
runtime:
  one_of: process
  command: /bin/sleep 3600
ports:
  - name: api
    port: 9090
restart:
  mode: service
  attempts: 3
  delay: 5s
update:
  strategy: canary
  canary: 1
  max_parallel: 1
  auto_promote: false
  min_healthy_time: 30s
  healthy_deadline: 5m
service:
  name: api
  port: 9090
  bind: 127.0.0.1
health:
  check_type: http
  interval: 10s
  timeout: 2s
  unhealthy_threshold: 3
constraints:
  - node.role == "api"
  - node.cpus >= 2
env:
  DB_HOST: postgres
  DB_PORT: "5432"
  LOG_LEVEL: info
---
# API Server

Backend API service binding to 127.0.0.1:9090 (TCP opt-in, R-007).
Canary update strategy with manual promote. Two replicas with CPU
constraint (>= 2 vCPUs) and API-role node selection.

> **Production substitution**: replace `runtime.command` with your
> actual API binary, e.g. `/usr/bin/api-server --listen 127.0.0.1:9090`.