Local Development
StackSolo includes a local development environment that mirrors your production setup using Kubernetes.
Prerequisites
Section titled “Prerequisites”- OrbStack with Kubernetes enabled (recommended for macOS)
- Or any local Kubernetes cluster (minikube, Docker Desktop, etc.)
kubectlCLI
Quick Start
Section titled “Quick Start”# Start local environmentstacksolo dev
# Check what's runningstacksolo dev --status
# View logsstacksolo dev --logs
# Stop everythingstacksolo dev --stopWhat Gets Created
Section titled “What Gets Created”When you run stacksolo dev, it creates Kubernetes resources that mirror your config:
| Your Config | Local Equivalent |
|---|---|
| Functions | K8s Deployment + Service |
| Containers | K8s Deployment + Service |
| UIs | K8s Deployment + Service |
| Load balancer routes | K8s Ingress |
| Kernel | K8s Deployment (NATS + HTTP) |
| GCP Kernel | K8s Deployment (HTTP only) |
Plus automatic emulators:
- Firebase Emulator (Firestore, Auth)
- Pub/Sub Emulator
Default Ports
Section titled “Default Ports”| Service | Port |
|---|---|
| Ingress (your app) | 8000 |
| Firebase Firestore | 8080 |
| Firebase Auth | 9099 |
| Firebase UI | 4000 |
| Pub/Sub | 8085 |
| Kernel HTTP | 8090 |
| Kernel NATS | 4222 |
| GCP Kernel | 8080 |
Commands
Section titled “Commands”Start Development
Section titled “Start Development”stacksolo devBuilds and deploys all services to local Kubernetes.
Check Status
Section titled “Check Status”stacksolo dev --statusShows running pods and their status.
View Logs
Section titled “View Logs”# All logsstacksolo dev --logs
# Specific servicestacksolo dev --logs apiRebuild
Section titled “Rebuild”# Force regenerate K8s manifestsstacksolo dev --rebuildstacksolo dev --stopTears down all Kubernetes resources.
How It Works
Section titled “How It Works”-
Manifest Generation: StackSolo reads your config and generates Kubernetes manifests in
.stacksolo/k8s/ -
Image Building: For each function/container, it builds a Docker image locally
-
Deployment: Applies manifests to your local Kubernetes cluster
-
Port Forwarding: Sets up ingress so you can access your app at
localhost:8000
Environment Variables
Section titled “Environment Variables”In local dev, environment variable references are resolved:
{ "env": { "DATABASE_URL": "@database/db.connectionString" }}Becomes something like:
DATABASE_URL=postgres://user:pass@db-service:5432/mydbUsing the Kernel
Section titled “Using the Kernel”If your config includes a kernel:
{ "kernel": { "name": "main", "firebaseProjectId": "my-project", "storageBucket": "uploads" }}Or GCP kernel:
{ "gcpKernel": { "name": "kernel", "firebaseProjectId": "my-project", "storageBucket": "uploads" }}The kernel is automatically built from source and deployed locally.
File Watching
Section titled “File Watching”Services are built with file watching enabled. When you change source files:
- The build process runs automatically
- Kubernetes picks up the new image
- Your changes are live
Troubleshooting
Section titled “Troubleshooting”Pods stuck in “Pending”
Section titled “Pods stuck in “Pending””Check if Kubernetes has enough resources:
kubectl describe pod <pod-name> -n stacksoloService not accessible
Section titled “Service not accessible”Check the ingress:
kubectl get ingress -n stacksoloBuild failing
Section titled “Build failing”Check the build logs:
stacksolo dev --logs <service-name>Reset everything
Section titled “Reset everything”stacksolo dev --stopkubectl delete namespace stacksolostacksolo devNext Steps
Section titled “Next Steps”- Deployment Guide - Deploy to GCP
- CLI Reference - All dev command options