Skip to content

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

helm repo add droidfarm https://christopherime.github.io/droidfarm/
helm repo update
helm install droidfarm droidfarm/droidfarm \
  --namespace droidfarm-system \
  --create-namespace \
  --set turn.credentials.username=myuser \
  --set turn.credentials.password=mypass
git clone https://github.com/christopherime/droidfarm.git
cd droidfarm
make deploy NAMESPACE=droidfarm-system

Requirements

  • Kubernetes 1.28+
  • Helm 3.x
  • Cilium 1.18+ with Gateway API enabled — enable-gateway-api-alpn: true and enable-gateway-api-app-protocol: true in kube-system/cilium-config
  • The cluster's shared Cilium Gateway at kube-system/cilium-gateway exposing an https listener with a wildcard certificate covering the streaming domain (per-device HTTPRoute objects 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