Skip to main content

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: *.myapp.acme.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.acme.getwebstack.dev
πŸ”— App: https://app.myapp.acme.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​

OptionDescriptionDefault
-w, --worktree <name>Worktree name to deployMain project deployment
-p, --project <name>Project name to deploy fromAuto-detected from current directory
-y, --yesSkip confirmation promptsfalse

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

Accessing your services (unified URLs)​

After gws up, each HTTP service is reachable locally at a unified URL that is identical to the one a visitor uses when you gws share it:

https://<service>.<project>.<org>.getwebstack.dev

The same URL works whether you run the app locally or share it β€” no per‑environment config, no CORS surprises when you flip between the two. gws up prints these URLs when your deployment is registered with an organization.

  • Port :443 (no port in the URL). On k3d, gws up maps the cluster gateway onto host 443 so the URL is portless, exactly like the shared origin. This is bound to 127.0.0.1 only (not exposed to your LAN).
  • Fallback to :9443. If host 443/80 is already in use, Docker runs rootless, or you use a non‑k3d provider, gws up prints the URL with :9443 and tells you why. Free port 443 (k3d) for full same‑port parity.
  • .local URLs are gone. The CLI no longer emits local.getwebstack.dev hosts β€” the unified {service}.{projectSlug}.{orgSlug}.getwebstack.dev host is the only one. (The static *.local DNS record is kept only so deployments from older gws versions keep resolving.)

Calling one service from another in the browser​

The unified host is shared across your services (the gws-namespace cookie selects the deployment), so a cross‑subdomain call from client.* to server.* must send that cookie. Configure your app accordingly:

  • Client: send credentials on cross‑origin requests β€” e.g. fetch(url, { credentials: "include" }) or Axios withCredentials: true.
  • Server: set CORS credentials: true and allow the portless unified origin (https://client.<project>.<org>.getwebstack.dev) β€” not the :9443 form.

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:

  1. Detects all repositories in myapp/ (api, app)
  2. Builds Docker image for each service
  3. Deploys all services to namespace myapp
  4. Sets up routing for all services

Result:

Services available at:
πŸ”— API: https://api.myapp.acme.getwebstack.dev
πŸ”— App: https://app.myapp.acme.getwebstack.dev

Deploying Worktree​

cd myapp
gws up -w feature-auth

What happens:

  1. Detects all repositories in myapp/
  2. Finds worktree feature-auth under .worktrees/
  3. Builds Docker images from worktree directories
  4. Deploys all services to namespace myapp-feature-auth
  5. 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.acme.getwebstack.dev
πŸ”— App: https://app.myapp.acme.getwebstack.dev
πŸ”— Picker: https://myapp.acme.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.acme.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​