Documentation

Comprehensive guides and references for StreamSpace

Overview

StreamSpace is a Kubernetes-native multi-user platform that streams containerized applications to web browsers using VNC technology. It provides on-demand provisioning with auto-hibernation for resource efficiency.

Key Concepts

Architecture

StreamSpace uses a multi-platform event-driven architecture with NATS messaging:

1. Platform Controllers

Platform-specific controllers that manage sessions on their respective infrastructure via NATS events.

View detailed architecture →

2. API Backend

Go-based REST + WebSocket API using Gin framework.

API Backend documentation →

3. Web UI

React + TypeScript web interface with Material-UI.

UI documentation →

Installation

See the Getting Started guide for detailed installation instructions.

Quick Install

BASH
# Clone repository
git clone https://github.com/JoshuaAFerguson/streamspace.git
cd streamspace

# Install with Helm
helm install streamspace ./chart \\
  --namespace streamspace \\
  --create-namespace

Usage

Creating Sessions

Sessions can be created via the Web UI, kubectl, or API.

Using kubectl

BASH
kubectl apply -f - <

Using the API

BASH
curl -X POST http://api.streamspace.local/api/v1/sessions \\
  -H "Authorization: Bearer $TOKEN" \\
  -H "Content-Type: application/json" \\
  -d '{
    "user": "user1",
    "template": "firefox-browser",
    "state": "running",
    "resources": {
      "memory": "2Gi",
      "cpu": "1000m"
    }
  }'

Managing Sessions

BASH
# List sessions
kubectl get sessions -n streamspace

# Get session details
kubectl describe session user1-firefox -n streamspace

# Hibernate a session
kubectl patch session user1-firefox -n streamspace \\
  --type merge -p '{"spec":{"state":"hibernated"}}'

# Wake a session
kubectl patch session user1-firefox -n streamspace \\
  --type merge -p '{"spec":{"state":"running"}}'

# Delete a session
kubectl delete session user1-firefox -n streamspace

API Reference

Session Endpoints

  • GET /api/v1/sessions - List all sessions
  • POST /api/v1/sessions - Create a session
  • GET /api/v1/sessions/:id - Get session details
  • PUT /api/v1/sessions/:id - Update session
  • DELETE /api/v1/sessions/:id - Delete session

Template Endpoints

  • GET /api/v1/templates - List templates
  • GET /api/v1/templates/:id - Get template details
  • GET /api/v1/catalog/templates - Browse catalog

Plugin Endpoints

  • GET /api/v1/plugins/catalog - Browse plugins
  • POST /api/v1/plugins/install - Install plugin
  • GET /api/v1/plugins/installed - List installed plugins

Full API documentation →

Development

Kubernetes Controller Development

BASH
cd k8s-controller

# Run locally
make run

# Run tests
make test

# Build Docker image
make docker-build IMG=myregistry/streamspace-kubernetes-controller:dev

Kubernetes controller development guide →

Docker Controller Development

BASH
cd docker-controller

# Build locally
go build -o streamspace-docker-controller

# Run with Docker Compose
./scripts/docker-dev.sh

# Test NATS connectivity
./scripts/test-nats.sh

API Development

BASH
cd api

# Run locally
go run cmd/main.go

# Run tests
go test ./...

UI Development

BASH
cd ui

# Install dependencies
npm install

# Run development server
npm run dev

# Build for production
npm run build

Deployment

Production Deployment

Create a production values file:

YAML
controller:
  replicaCount: 3
  leaderElection:
    enabled: true
  resources:
    requests:
      memory: 512Mi
      cpu: 500m

api:
  replicaCount: 3
  autoscaling:
    enabled: true
    minReplicas: 3
    maxReplicas: 10

ui:
  replicaCount: 2

postgresql:
  enabled: false
  external:
    enabled: true
    host: "postgres.example.com"

ingress:
  enabled: true
  className: "nginx"
  tls:
    enabled: true
    secretName: "streamspace-tls"

monitoring:
  enabled: true

Resource Requirements

Component CPU Memory
Controller 500m 512Mi
API Backend 1000m 1Gi
Web UI 100m 256Mi
PostgreSQL 1000m 2Gi

Further Reading