Skip to content

API Service

The API service is the main entry point for Flow-Like on Kubernetes. It handles:

  • User requests — Authentication, apps, workflows
  • Job management — Submit and track workflow executions
  • Health checks — Kubernetes probes for reliability
┌─────────────────────────────────────────────────────────┐
│ API Service │
│ (Port 8080) │
├─────────────────────────────────────────────────────────┤
│ │
│ /health/* → Kubernetes probes (live, ready, etc.) │
│ /jobs/* → Job submission and management │
│ /api/v1/* → Flow-Like API (auth, apps, etc.) │
│ │
└─────────────────────────────────────────────────────────┘
│ │
▼ ▼
┌──────────┐ ┌─────────────┐
│ Redis │ │ CockroachDB │
│ (Queue) │ │ (Database) │
└──────────┘ └─────────────┘
ComponentLocation
Main entrypointapps/backend/kubernetes/api/src/main.rs
Configurationapps/backend/kubernetes/api/src/config.rs
Health endpointsapps/backend/kubernetes/api/src/health.rs
Job managementapps/backend/kubernetes/api/src/jobs/
Storage setupapps/backend/kubernetes/api/src/storage.rs

The API supports multiple storage backends:

ProviderConfiguration Key
AWS S3aws
Azure Blobazure
Google Cloud Storagegcp
Cloudflare R2r2
S3-compatible (MinIO, etc.)s3

See Storage Configuration for details.

At minimum, the API needs:

VariablePurpose
DATABASE_URLCockroachDB/PostgreSQL connection
REDIS_URLJob queue and caching
STORAGE_PROVIDERWhich storage backend to use
Storage credentialsDepends on provider

See Configuration for the full list.

The API always listens on port 8080 inside the container. This is:

  • Set in the Helm chart (values.yaml)
  • Used by the Kubernetes Service definition
  • Exposed via port-forward, Ingress, or LoadBalancer

To access it locally:

Terminal window
# Forward local 8083 → service 8080
kubectl port-forward svc/flow-like-api 8083:8080 -n flow-like
# Test it
curl http://localhost:8083/api/v1/health

The API is stateless and can be horizontally scaled. Default configuration:

  • Minimum replicas: 3
  • Maximum replicas: 10
  • Scale trigger: 70% CPU utilization
Terminal window
# Manual scaling
kubectl scale deployment/flow-like-api --replicas=5 -n flow-like
# Check autoscaler
kubectl get hpa -n flow-like
Terminal window
# View logs
kubectl logs deployment/flow-like-api -n flow-like
# Follow in real-time
kubectl logs deployment/flow-like-api -n flow-like -f
# Last 100 lines
kubectl logs deployment/flow-like-api -n flow-like --tail=100