README
¶
Flyte Manager - Unified Binary
The Flyte Manager is a unified binary that runs all Flyte services in a single process:
- Runs Service (port 8090) - Manages workflow runs and action state
- Queue Service (port 8089) - Creates and manages TaskAction CRs in Kubernetes
- Executor/Operator (port 8081 health) - Reconciles TaskAction CRs and transitions them through states
Features
✅ Single Binary - One process to deploy and manage ✅ Single SQLite Database - All data in one file ✅ Auto Kubernetes Detection - Uses current kubeconfig ✅ Unified Configuration - One config file for all services ✅ HTTP/2 Support - Buf Connect compatible
Quick Start
Prerequisites
- Kubernetes cluster (k3d, kind, minikube, or any cluster)
- Go 1.24 or later
- TaskAction CRD installed in the cluster
- Kubeconfig configured (or running in-cluster)
Install TaskAction CRD
kubectl apply -f ../executor/config/crd/bases/flyte.org_taskactions.yaml
Build and Run
# Build the binary
make build
# Run the manager
make run
# Or run directly
./bin/flyte-manager --config config.yaml
The manager will:
- Initialize a SQLite database (
flyte.db) - Run database migrations
- Start all three services in parallel goroutines
- Connect to your Kubernetes cluster
- Begin reconciling TaskAction CRs
Configuration
Edit config.yaml:
manager:
runsService:
host: "0.0.0.0"
port: 8090
queueService:
host: "0.0.0.0"
port: 8089
executor:
healthProbePort: 8081
kubernetes:
namespace: "flyte"
# Optional: specify custom kubeconfig path
# kubeconfig: "/path/to/kubeconfig"
database:
type: "sqlite"
sqlite:
file: "flyte.db"
logger:
level: 4 # Info level
show-source: true
Architecture
┌─────────────────────────────────────────────────────────┐
│ Flyte Manager Process │
├─────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌───────────────┐ ┌──────────────┐ │
│ │ Runs Service │ │ Queue Service │ │ Executor │ │
│ │ :8090 │ │ :8089 │ │ │ │
│ │ │ │ │ │ Reconciles │ │
│ │ - RunService │ │ Creates K8s │ │ TaskActions │ │
│ │ - StateServ. │ │ TaskAction CRs│ │ │ │
│ └──────┬───────┘ └───────┬───────┘ └──────┬───────┘ │
│ │ │ │ │
│ └──────────────────┴──────────────────┘ │
│ │ │
│ ┌────────┴────────┐ │
│ │ SQLite DB │ │
│ │ flyte.db │ │
│ └─────────────────┘ │
└─────────────────────────────────────────────────────────┘
│
↓
Kubernetes Cluster
(TaskAction CRs)
API Endpoints
Runs Service (port 8090)
POST /flyteidl2.workflow.RunService/CreateRun- Create a new runPOST /flyteidl2.workflow.RunService/GetRun- Get run detailsPOST /flyteidl2.workflow.RunService/ListRuns- List runsPOST /flyteidl2.workflow.RunService/AbortRun- Abort a runPOST /flyteidl2.workflow.StateService/Put- Update action statePOST /flyteidl2.workflow.StateService/Get- Get action statePOST /flyteidl2.workflow.StateService/Watch- Watch state updatesGET /healthz- Health checkGET /readyz- Readiness check
Queue Service (port 8089)
POST /flyteidl2.workflow.QueueService/EnqueueAction- Create TaskAction CRPOST /flyteidl2.workflow.QueueService/AbortQueuedRun- Delete root TaskActionPOST /flyteidl2.workflow.QueueService/AbortQueuedAction- Delete specific TaskActionGET /healthz- Health checkGET /readyz- Readiness check
Executor (port 8081)
GET /healthz- Health checkGET /readyz- Readiness check
How It Works
- CreateRun → Runs Service persists run to SQLite DB
- CreateRun → Runs Service calls Queue Service to enqueue root action
- EnqueueAction → Queue Service creates TaskAction CR in Kubernetes
- Executor → Watches TaskAction CRs and reconciles them
- Executor → Transitions: Queued → Initializing → Running → Succeeded
- Executor → Calls State Service Put() on each transition
- State Service → Persists state updates to SQLite DB
- State Service → Notifies watchers of state changes
Testing
Check Services
# Runs Service health
curl http://localhost:8090/healthz
# Queue Service health
curl http://localhost:8089/healthz
# Executor health
curl http://localhost:8081/healthz
Watch TaskActions
# List all TaskActions
kubectl get taskactions -n flyte
# Watch TaskActions in real-time
kubectl get taskactions -n flyte -w
# Get details of a specific TaskAction
kubectl describe taskaction <name> -n flyte
Check Database
# Open SQLite database
sqlite3 flyte.db
# List tables
.tables
# Query runs
SELECT * FROM runs;
# Query actions
SELECT name, phase, state FROM actions;
Deployment
Local Development
make run
Docker
FROM golang:1.21 AS builder
WORKDIR /app
COPY . .
RUN cd manager && make build
FROM alpine:latest
RUN apk --no-cache add ca-certificates sqlite
WORKDIR /root/
COPY --from=builder /app/manager/bin/flyte-manager .
COPY --from=builder /app/manager/config.yaml .
CMD ["./flyte-manager", "--config", "config.yaml"]
Kubernetes
Deploy as a single pod with access to the Kubernetes API:
apiVersion: apps/v1
kind: Deployment
metadata:
name: flyte-manager
namespace: flyte
spec:
replicas: 1
selector:
matchLabels:
app: flyte-manager
template:
metadata:
labels:
app: flyte-manager
spec:
serviceAccountName: flyte-manager
containers:
- name: manager
image: flyte-manager:latest
ports:
- containerPort: 8090
name: runs
- containerPort: 8089
name: queue
- containerPort: 8081
name: health
Troubleshooting
Connection Issues
Error: "failed to get Kubernetes config"
# Verify kubeconfig
kubectl cluster-info
# Or set explicit kubeconfig in config.yaml
manager:
kubernetes:
kubeconfig: "/path/to/kubeconfig"
Database Issues
Error: "failed to run migrations"
# Remove and recreate database
rm flyte.db
./bin/flyte-manager --config config.yaml
Port Conflicts
Error: "address already in use"
# Check what's using the ports
lsof -i :8090
lsof -i :8089
lsof -i :8081
# Change ports in config.yaml
manager:
runsService:
port: 9090 # Changed from 8090
Development
Build
make build
Clean
make clean
Run Tests
make test
Click to show internal directories.
Click to hide internal directories.