DroidFarm¶
Kubernetes-native Android device farm for scalable, reproducible E2E testing
DroidFarm runs fleets of Google Cuttlefish Android virtual devices on Kubernetes, streams each device to any web browser via WebRTC, and orchestrates Appium E2E test runs through declarative device templates.
Features¶
| Feature | Description |
|---|---|
| Browser access | Cuttlefish WebRTC streaming — no client software needed |
| Declarative templates | DeviceTemplate CRD declares Android version, apps, managed config, permissions |
| Scalable pools | DevicePool manages fleets from 1 to N emulators; KEDA autoscales on queue depth |
| Reproducible tests | TestSession CRD drives Appium runs with full session isolation |
| Resource-aware | LimitRange enforcement, standard container security (no --privileged, no KVM required) |
| Multi-app | Primary AUT plus companion apps with cross-app interaction in one template |
| Observability | Prometheus metrics; operator emits boot time, session duration, and device state gauges per pool |
Architecture Overview¶
flowchart LR
Browser["Web Browser"]
subgraph K8s["Kubernetes Cluster"]
GW["Shared Cilium Gateway\nkube-system/cilium-gateway\nhttps · *.STREAMING_DOMAIN"]
Operator["Operator\nGo / controller-runtime\n+ per-device HTTPRoute"]
Dashboard["Dashboard\nGo + HTMX · :8080"]
subgraph Pool["DevicePool StatefulSet"]
Envoy["envoy sidecar\nh2c :8080"]
CF["Cuttlefish\ngRPC :8554 · ADB :5554"]
Envoy --> CF
end
COTURN["coturn\nTURN/STUN"]
Operator -->|"manages"| Pool
GW -->|"HTTPRoute · h2c"| Envoy
end
COTURN -->|"TURN relay"| Browser
Browser <-->|"HTTPS / HTTP/2"| GW
Browser <-->|"HTMX"| Dashboard
Browser <-->|"WebDriver"| Appium Full diagram and component breakdown: Architecture →
Quick Install¶
Requirements¶
- Kubernetes 1.28+
- Helm 3.x
- Cilium 1.18+ with Gateway API enabled —
enable-gateway-api-alpn: trueandenable-gateway-api-app-protocol: trueinkube-system/cilium-config - The cluster's shared Cilium Gateway at
kube-system/cilium-gatewayexposing anhttpslistener with a wildcard certificate covering the streaming domain (per-deviceHTTPRouteobjects attach to it by default). A dedicated streaming Gateway can be rendered from the chart instead — see Per-Device Streaming Gateway. - cert-manager with a working cluster issuer (used to mint the wildcard cert that backs the streaming domain)
- KEDA (optional, for autoscaling)
Nodes with /dev/kvm are optional. See Hardware Acceleration if you want faster boot times.
License¶
Apache 2.0