gws up
Deploy services to a Kubernetes cluster.
Usageโ
gws up [options]
Output:
๐ Deploying GetWebstack...
โ Validating dependencies...
โ Docker: 24.0.0
โ Git: 2.40.0
โ mkcert: 1.4.4
โ Creating k3d cluster 'myapp'... (15s)
โ Generating TLS certificates...
โ Created: *.local.getwebstack.dev
โ Building Docker images...
โ api: localhost:5000/myapp-api:latest (25s)
โ app: localhost:5000/myapp-app:latest (30s)
โ Deploying to namespace 'myapp'...
โ Created namespace
โ Deployed 2 services
โ Pods running (2/2)
โ Configuring Gateway API...
โ Created HTTPRoutes
โ Port-forward active (8080, 9443)
โ Starting file sync...
โ api: active (0.5s latency)
โ app: active (0.6s latency)
โ Activating auto-rebuild watchers...
โ Watching Dockerfiles
Deployment successful! ๐
Services available at:
๐ API: https://api.myapp.local.getwebstack.dev
๐ App: https://app.myapp.local.getwebstack.dev
File sync active:
๐ File sync: โ (0.5s latency)
๐ Auto-rebuild: โ (Dockerfile changes)
Next steps:
- Edit code locally (changes sync automatically)
- View status: gws status
- View logs: gws logs
- Stop: gws down
Note: This command must be run from within your project directory.
Optionsโ
| Option | Description | Default |
|---|---|---|
-w, --worktree <name> | Worktree name to deploy | Main project deployment |
-p, --project <name> | Project name to deploy from | Auto-detected from current directory |
-y, --yes | Skip confirmation prompts | false |
Examples:
# Deploy from a specific project, a specific worktree
gws up -p myapp -w feature-auth
# Deploy specific worktree for current directory project.
gws up -w feature-auth
# Deploy from a specific project. Deploys the main project, not a worktree.
gws up -p myapp
# Skip prompts
gws up -y
# deploy project from current dorectory
gws up
Multirepo Behaviorโ
When running gws up in a multirepo setup, the command deploys all services from each repository to a single Kubernetes namespace.
Project Structureโ
myapp/ # Parent directory
โโโ .worktrees/ # Shared worktrees folder (at parent level)
โ โโโ feature-auth/ # One folder per worktree name
โ โโโ api/ # Worktree for api repo
โ โ โโโ src/
โ โโโ app/ # Worktree for app repo
โ โโโ src/
โโโ api/ # Git repo 1
โ โโโ .git/
โ โโโ src/
โโโ app/ # Git repo 2
โโโ .git/
โโโ src/
Deploying Main Workspaceโ
cd myapp
gws up
What happens:
- Detects all repositories in
myapp/(api, app) - Builds Docker image for each service
- Deploys all services to namespace
myapp - Sets up routing for all services
Result:
Services available at:
๐ API: https://api.myapp.local.getwebstack.dev
๐ App: https://app.myapp.local.getwebstack.dev
Deploying Worktreeโ
cd myapp
gws up -w feature-auth
What happens:
- Detects all repositories in
myapp/ - Finds worktree
feature-authunder.worktrees/ - Builds Docker images from worktree directories
- Deploys all services to namespace
myapp-feature-auth - Sets up routing for all services
Result:
Services available at (same hostnames as the default deployment;
the `gws-namespace` cookie selects this fork):
๐ API: https://api.myapp.local.getwebstack.dev
๐ App: https://app.myapp.local.getwebstack.dev
๐ Picker: https://myapp.local.getwebstack.dev (choose deployment)
Key Points:
- All services from different repos deploy to the same namespace
- Each worktree gets its own isolated namespace
- File sync is active for all services in the deployment
Troubleshootingโ
Docker Not Runningโ
# Start Docker Desktop (macOS/Windows)
open -a Docker
# Or start Docker daemon (Linux)
sudo systemctl start docker
# Verify
docker ps
# Try again
gws up
Port Already in Useโ
# Find process using port
sudo lsof -ti:8080
# Kill process
sudo lsof -ti:8080 | xargs kill -9
# Try again
gws up
Build Failedโ
# Ensure Dockerfile exists
ls api/Dockerfile
# Check pod logs
gws logs api
DNS Not Resolvingโ
# Test DNS
nslookup api.myapp.local.getwebstack.dev
# Should return: 127.0.0.1
# Flush DNS cache:
# macOS: sudo dscacheutil -flushcache
# Linux: sudo systemd-resolve --flush-caches
# Windows: ipconfig /flushdns
See Alsoโ
- gws down - Stop deployment
- gws status - View deployment status
- gws logs - View service logs
- gws fork - Create worktree before deploying
- gws cluster up - Provision cluster + shared infra without deploying a project