browser-service

June 19, 2026 · View on GitHub

REST + Server-Sent-Events facade over the Selenosis Browser and BrowserConfig resources. It gives clients a plain HTTP API and a real-time event stream on top of the Kubernetes CRDs — without ever creating Pods itself.

GitHub release Go Reference Docker Pulls codecov Go Report Card License


What it does

  • CRUD over CRDs. Create, get, list, and delete Browser and BrowserConfig resources through a namespaced HTTP API.
  • Real-time events. Streams ADDED / MODIFIED / DELETED lifecycle events for both resource types over Server-Sent Events, optionally filtered by name.
  • Read-only status. Surfaces Browser.status (phase, pod IP, failure message) so clients can wait on readiness or react to failures.
  • A thin, stateless facade. It does not create Pods or act as a controller — all writes go straight to the Kubernetes API server; no state is kept outside Kubernetes.

It's the boundary between protocol semantics and Kubernetes resources: the selenosis hub calls it to create sessions and watch for readiness, and browser-ui consumes its event stream for the live session list.


How it fits

ComponentRole
selenosisStateless Selenium / Playwright / MCP hub. Calls this service to create sessions and watch readiness.
seleniferousSidecar proxy inside each browser pod.
browser-controllerOperator that reconciles Browser / BrowserConfig CRDs into pods. Owns the CRD types this service uses.
browser-service (this repo)REST + SSE facade over Browser and BrowserConfig resources.
browser-uiDashboard; consumes this service's event stream + VNC.
selenosis-deployHelm chart that deploys the whole stack. Start here.

Depends on browser-controller for the Browser / BrowserConfig CRD definitions and generated clientsets/informers/listers. CRDs must be installed and the controller running.


API

All endpoints are namespaced under /api/v1/namespaces/{namespace}.

Browsers

MethodPathDescription
POST/browsersCreate a Browser.
GET/browsers/{name}Get a single Browser.
DELETE/browsers/{name}Delete a Browser.
GET/browsersList browsers in the namespace.
GET/browsers/eventsStream browser lifecycle events (SSE). Optional ?name= to filter.

BrowserConfigs

MethodPathDescription
POST/browserconfigsCreate a BrowserConfig.
GET/browserconfigs/{name}Get a single BrowserConfig.
DELETE/browserconfigs/{name}Delete a BrowserConfig.
GET/browserconfigsList browserconfigs in the namespace.
GET/browserconfigs/eventsStream BrowserConfig lifecycle events (SSE). Optional ?name= to filter.

Health

GET /healthz200 OK when the service is running.


Events & runtime model

Event types are ADDED, MODIFIED, and DELETED. Browser events carry the full Browser object (incl. status.phase / status.podIP / failure message); BrowserConfig events carry the full BrowserConfig.

How events are produced and fanned out
  • The service uses shared informers to watch Browser and BrowserConfig resources.
  • Events are delivered to connected clients through an in-memory fan-out broadcaster.
  • Subscribers may pass a predicate to receive only events for a specific resource name.
  • Nothing is persisted outside Kubernetes; all writes forward directly to the API server.

Build

The project builds and packages entirely via Docker — a local Go install is not required.

Makefile build variables
VariableDescription
BINARY_NAMEName of the produced binary (fixed: browser-service).
REGISTRYDocker registry prefix (default: localhost:5000).
IMAGE_NAMEFull image name, derived as $(REGISTRY)/$(BINARY_NAME).
VERSIONImage version/tag (default: develop).
EXTRA_TAGSAdditional -t tags passed to docker-push (default: none).
PLATFORMTarget platform (default: linux/amd64).
CONTAINER_TOOLContainer build tool (default: docker).

REGISTRY and VERSION are expected to be supplied externally so the same Makefile works locally and in CI.


Deployment

Deployed as part of the full stack via the selenosis-deploy Helm chart.


License

Apache-2.0