remote agentic devbox setup cocadmin A developer published a step-by-step guide for running multiple Git branches of an application simultaneously on a single k3s machine, with each branch getting its own isolated namespace, database, PVCs and HTTPS URL. The setup pairs a Helm chart that mounts source code from Git worktrees via hostPath with a Bash environment manager (env.sh) that creates and tears down environments using helm upgrade --install, and routes traffic through a Cloudflare tunnel Ingress. The guide recommends roughly 8 CPU cores and 32 GB RAM for two to three concurrent environments. | | Devbox setup — live Git worktree environments on k3s | | | Set up a system allowing multiple Git branches of an application to run simultaneously on a developer machine, with isolated environments, live reloading and individual HTTPS URLs. | | | Work through the following steps in order. Verify the Cloudflare tunnel before enabling Cloudflare Access. | | | Assumptions | | | - Ubuntu or similar machine with sudo access. | | | - Around 8 CPU cores and 32 GB RAM for 2–3 simultaneous environments, depending on the application. | | | - The application repository is cloned locally. | | | - The user has or will create a Cloudflare account and domain. | | | Prerequisite — Application Helm chart | | | The application needs Kubernetes manifests packaged as a Helm chart in deploy/worktree/ . If they do not exist, inspect the application's architecture, Dockerfiles, Docker Compose configuration and development commands, and generate them first. | | | The chart must: | | | - Mount source code directly from the Git worktree using hostPath . | | | - Run development servers with hot-reload and automatic dependency installation. | | | - Deploy independent application services, databases and PVCs per environment. | | | - Initialize databases from development dumps or seed scripts. | | | - Expose services through an Ingress using ingressClassName: cloudflare-tunnel . | | | - Configure frontend allowed hosts and HMR for dynamic HTTPS hostnames. | | | - Allow optional services to be disabled through Helm values. | | | Generate the environment manager | | | If missing, generate an executable Bash script at deploy/worktree/env.sh supporting: | | | bash | | | env.sh up --path