feat: DevContainer 2.0.0-dev with serverless architecture and unified Helm chart #52

Merged
cpfarhood merged 4 commits from feature/serverless-2.0.0 into main 2026-02-25 13:55:16 +00:00
cpfarhood commented 2026-02-25 13:14:17 +00:00 (Migrated from github.com)

Summary

This PR introduces DevContainer 2.0.0-dev with a complete serverless architecture and unified Helm chart supporting both persistent and dynamic deployment modes.

Issues Addressed

  • Closes #11 — Built-in web file manager via base image's WEB_FILE_MANAGER
  • Closes #49 — Helm CLI v3.17.1 added to Docker image

Deployment Modes

Persistent (deploymentMode: persistent) — Default

Traditional v1.x behavior. Long-lived deployment with PVC storage, MCP sidecars, and SSH support. Fully backward compatible.

Dynamic (deploymentMode: dynamic) — New

Serverless model using Knative auto-scaling from 0 to N instances, with dynamic GitHub repository routing via URL path and Authentik authentication.

Architecture (Dynamic Mode)

https://devcontainer.farh.net/github/microsoft/vscode
    ↓
🔐 Authentik (Authentication + User Headers)
    ↓  
🌐 NGINX Ingress (SSL + Forward Auth)
    ↓
📋 Routing Proxy (Extracts GitHub repo from URL)  
    ↓
⚡ Knative Service (Auto-scales 0→N instances)
    ↓
🐳 Dev Container (Ephemeral, repo-specific)

Usage Examples

# Persistent mode (default, v1.x compatible)
helm install mydev ./chart --set name=mydev --set githubRepo=https://github.com/user/repo

# Dynamic serverless mode
helm install mydev ./chart \
  --set deploymentMode=dynamic \
  --set name=mydev \
  --set dynamic.ingress.host=devcontainer.farh.net

# Using example values file
helm install mydev ./chart -f chart/values-dynamic.yaml

CI/CD

Both images are now built automatically on push to feature/serverless-2.0.0:

Image Tag Build Trigger
ghcr.io/cpfarhood/devcontainer 2.0.0-dev Push to feature/serverless-*
ghcr.io/cpfarhood/devcontainer-routing-proxy 2.0.0-dev Push to feature/serverless-2.0.0

The chart defaults to image.tag: 2.0.0-dev so Helm installs pull the development images automatically.

Key Changes

Container Enhancements

  • Helm CLI v3.17.1 installed in Dockerfile (#49)
  • Built-in web file manager via WEB_FILE_MANAGER (#11)
  • Serverless startup scripts for dynamic repo initialization
  • Mode detection in startapp.sh

Helm Chart (v2.0.0-dev)

  • New deploymentMode field: persistent | dynamic
  • Conditional template rendering based on mode
  • New templates: knative-service.yaml, routing-proxy.yaml, dynamic-ingress.yaml
  • New dynamic.* values section for Knative, routing proxy, ingress, and Authentik config
  • values-dynamic.yaml example for serverless deployments
  • PVC, Service, Deployment, RBAC — only deployed in persistent mode

Serverless Infrastructure

  • NGINX routing proxy for GitHub repo extraction from URL paths
  • Knative Service with auto-scaling (0→N) and per-request isolation
  • Authentik forward auth integration on ingress
  • Complete documentation and Makefile in serverless/

CI/CD Updates

  • Build triggers on feature/serverless-* branches
  • 2.0.0-dev tags for both devcontainer and routing proxy images
  • Parallel build jobs for main image and routing proxy

Backward Compatibility

All existing 1.x deployments continue working unchanged:

  • deploymentMode defaults to persistent
  • All existing values and templates preserved
  • No breaking changes

Test Plan

  • Verify persistent mode still works with existing values
  • helm template renders correctly for both modes
  • CI builds both images with 2.0.0-dev tag
  • Routing proxy extracts repo from /github/{owner}/{repo}
  • Knative Service scales from 0 on first request
  • Authentik forward auth blocks unauthenticated access
  • File manager accessible in both modes

🤖 Generated with Claude Code

## Summary This PR introduces DevContainer 2.0.0-dev with a complete serverless architecture and unified Helm chart supporting both **persistent** and **dynamic** deployment modes. ### Issues Addressed - Closes #11 — Built-in web file manager via base image's `WEB_FILE_MANAGER` - Closes #49 — Helm CLI v3.17.1 added to Docker image ## Deployment Modes ### Persistent (`deploymentMode: persistent`) — Default Traditional v1.x behavior. Long-lived deployment with PVC storage, MCP sidecars, and SSH support. **Fully backward compatible.** ### Dynamic (`deploymentMode: dynamic`) — New Serverless model using Knative auto-scaling from 0 to N instances, with dynamic GitHub repository routing via URL path and Authentik authentication. ## Architecture (Dynamic Mode) ``` https://devcontainer.farh.net/github/microsoft/vscode ↓ 🔐 Authentik (Authentication + User Headers) ↓ 🌐 NGINX Ingress (SSL + Forward Auth) ↓ 📋 Routing Proxy (Extracts GitHub repo from URL) ↓ ⚡ Knative Service (Auto-scales 0→N instances) ↓ 🐳 Dev Container (Ephemeral, repo-specific) ``` ## Usage Examples ```bash # Persistent mode (default, v1.x compatible) helm install mydev ./chart --set name=mydev --set githubRepo=https://github.com/user/repo # Dynamic serverless mode helm install mydev ./chart \ --set deploymentMode=dynamic \ --set name=mydev \ --set dynamic.ingress.host=devcontainer.farh.net # Using example values file helm install mydev ./chart -f chart/values-dynamic.yaml ``` ## CI/CD Both images are now built automatically on push to `feature/serverless-2.0.0`: | Image | Tag | Build Trigger | |-------|-----|---------------| | `ghcr.io/cpfarhood/devcontainer` | `2.0.0-dev` | Push to `feature/serverless-*` | | `ghcr.io/cpfarhood/devcontainer-routing-proxy` | `2.0.0-dev` | Push to `feature/serverless-2.0.0` | The chart defaults to `image.tag: 2.0.0-dev` so Helm installs pull the development images automatically. ## Key Changes ### Container Enhancements - Helm CLI v3.17.1 installed in Dockerfile (#49) - Built-in web file manager via `WEB_FILE_MANAGER` (#11) - Serverless startup scripts for dynamic repo initialization - Mode detection in `startapp.sh` ### Helm Chart (v2.0.0-dev) - New `deploymentMode` field: `persistent` | `dynamic` - Conditional template rendering based on mode - New templates: `knative-service.yaml`, `routing-proxy.yaml`, `dynamic-ingress.yaml` - New `dynamic.*` values section for Knative, routing proxy, ingress, and Authentik config - `values-dynamic.yaml` example for serverless deployments - PVC, Service, Deployment, RBAC — only deployed in persistent mode ### Serverless Infrastructure - NGINX routing proxy for GitHub repo extraction from URL paths - Knative Service with auto-scaling (0→N) and per-request isolation - Authentik forward auth integration on ingress - Complete documentation and Makefile in `serverless/` ### CI/CD Updates - Build triggers on `feature/serverless-*` branches - `2.0.0-dev` tags for both devcontainer and routing proxy images - Parallel build jobs for main image and routing proxy ## Backward Compatibility All existing 1.x deployments continue working unchanged: - `deploymentMode` defaults to `persistent` - All existing values and templates preserved - No breaking changes ## Test Plan - [ ] Verify persistent mode still works with existing values - [ ] `helm template` renders correctly for both modes - [ ] CI builds both images with `2.0.0-dev` tag - [ ] Routing proxy extracts repo from `/github/{owner}/{repo}` - [ ] Knative Service scales from 0 on first request - [ ] Authentik forward auth blocks unauthenticated access - [ ] File manager accessible in both modes 🤖 Generated with [Claude Code](https://claude.ai/code)
Sign in to join this conversation.