GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Caproni
  • Getting started
  • For GitLab
  • Source
  • Edit this page →

This view

  • Original page
  • New address

GeezerVison is showing gitlab-org.gitlab.io — Edit Mode Development Workflow

Edit Mode Development Workflow

Edit Mode Development Workflow

Overview

Edit mode enables local development with live cluster integration. Your code runs on your local machine with hot-reload capabilities while accessing cluster services (databases, Redis, etc.) as if running inside Kubernetes. This eliminates container rebuilds and enables use of local IDEs, debuggers, and development tools.

Core Concepts

What is Edit Mode?

Edit mode allows you to:

  • Run your application code locally on your development machine
  • Access Kubernetes cluster resources (databases, caches, services) as if your code were running in a pod
  • Make code changes that reflect immediately without rebuilding containers
  • Use local debugging tools (IDE debuggers, profilers, etc.)
  • Maintain hot-reload workflows for rapid iteration

How Edit Mode Works

Edit mode uses mirrord to create a bridge between your local process and a Kubernetes pod:

  1. Network mirroring: Your local process can access cluster services using cluster DNS
  2. Filesystem control: Choose whether to use local files, remote files, or a combination
  3. Process execution: Your application runs locally with full access to your development tools
  4. Cluster context: Environment variables, secrets, and configurations come from the cluster

mirrord Integration

mirrord intercepts system calls (via LD_PRELOAD on Linux/macOS) so your local process can:

  • Resolve cluster DNS names (e.g., postgresql.svc.cluster.local)
  • Access ConfigMaps and Secrets as environment variables or mounted files
  • Receive traffic routed through cluster ingress or services
  • Make outgoing requests through the cluster network

See the mirrord documentation for detailed technical information.

Prerequisites

Required Tools

  • kubectl - Kubernetes command-line tool (configured with cluster access)
  • mise - Development tool version manager ( mise-en-place)
  • Git - Version control
  • Cluster driver - Either colima (macOS) or k3d (Linux)
    • Linux with Podman: See the Linux Setup Guide for additional configuration

Project Structure

A typical Caproni project has these essential files:

my-caproni-project/
├── caproni.yaml                  # Configuration (required, committed to version control)
├── caproni.local.yaml            # Local overrides (optional, not committed — add to .gitignore)
├── values.yaml                   # Helm chart values (required for helm deployers)
└── README.md                     # Documentation (recommended)

Optional additions depending on your use case:

my-caproni-project/
├── .mise.toml                    # Tool version management (recommended)
├── scripts/
│   └── prepare-dev-env.sh        # Development environment setup (recommended)
├── <repository-name>/            # Cloned by caproni when needed
└── <chart-name>/                 # Cloned by caproni when needed

Note: caproni up automatically clones repositories when deployers or reloaders with edit_mode: true need them. Keep edit_mode: true in caproni.local.yaml (not committed) so your personal development settings don’t affect other team members.

Recommended setup pattern: For GitLab Infrastructure projects, consider adding scripts/prepare-dev-env.sh following the common-template-copier pattern. This script automates environment validation, runs mise install, and handles project-specific setup.

Configuration Reference

Basic Configuration

A minimal edit mode configuration:

version: 2

cluster:
  driver: auto # Auto-detects colima or k3d
  network:
    hostname: myapp.local

repositories:
  my-chart:
    repository: https://gitlab.com/example/chart.git
    directory: ./chart/
  myapp-code:
    repository: https://gitlab.com/example/app.git
    directory: ./app/

reloaders:
  myapp:
    type: mirror # Use mirrord for hot-reload
    repository: myapp-code
    edit_mode: true # Enable local development

    mirror:
      target:
        namespace: default
        kubernetes_type: deployment
        name: myapp

      filesystem:
        mode: local # Use local filesystem for code

      network:
        outgoing:
          ignore_localhost: true # Keep localhost requests local

      edit_mode_processes:
        app:
          command: npm start
          port: 3000

deployers:
  myapp:
    type: helm
    repository: my-chart
    helm:
      namespace: default
      values_file: ./values.yaml
      repository:
        name: my-charts
        url: https://charts.example.com
      release:
        name: myapp
        chart: my-charts/myapp

Configuration Options

Cluster Configuration

cluster:
  driver: auto # Auto-detects colima or k3d
  network:
    hostname: myapp.local # Primary hostname
    additional_hostnames:
      - api.myapp.local

Repository Configuration

repositories:
  <name>:
    repository: <git-url>
    directory: <local-path>

Repositories are cloned automatically when needed by deployers or reloaders with edit_mode: true.

Mirror Reloader Configuration

reloaders:
  <name>:
    type: mirror
    repository: <repository-name>
    edit_mode: <boolean>

    mirror:
      target:
        namespace: <namespace>
        kubernetes_type: <deployment|statefulset|pod>
        name: <resource-name>

      filesystem:
        mode: <local|read|write|localwithoverrides>

      network:
        outgoing:
          ignore_localhost: <boolean>

      edit_mode_processes:
        <process-name>:
          command: <command-to-run>
          port: <port-number> # optional
          env: # optional
            <NAME>: <value>

Filesystem Options

Mode types:

  • local - Use local filesystem entirely (recommended for most development)
  • localwithoverrides - Use local files but can selectively override with remote paths
  • read - Read-only access to remote filesystem
  • write - Full read-write access to remote filesystem

Additional filesystem options:

filesystem:
  mode: localwithoverrides
  read_only:
    - ".+\\.yaml$" # Read config files from cluster
  mapping:
    "/app/config": "/local/path/config" # Remap to absolute paths
    "/etc/config": "./other/config" # Remap to relative paths (CWD is repository folder)

Other available modes: read (read-only remote), write (read-write remote). See mirrord docs for details.

Network Options

network:
  outgoing:
    ignore_localhost: true # Requests to localhost stay local

When ignore_localhost: true, requests to localhost (e.g., service on localhost:3000) go to your local processes rather than mirrord intercepting and routing them to the cluster pod.

Edit Mode Processes

edit_mode_processes:
  <name>:
    command: <command> # Command to run locally
    port: <number> # Optional: port the process listens on
    env: # Optional: environment variables for the process
      <NAME>: <value>

Multiple processes run simultaneously, all within the same mirrord session. Each process shares the mirrored network and filesystem context.

Advanced Configuration

For complete configuration options, see the Configuration Guide.

Note: For applications that use mmap (memory-mapped files) or have complex filesystem requirements that mirrord doesn’t support, use the Skaffold reloader instead. See the Configuration Guide for Skaffold reloader setup.

Example Workflow

For a complete, step-by-step workflow with a real application, see the Local GitLab development guide in the gitlab-caproni repository.

The guide covers:

  • Complete project setup from scratch
  • Cluster initialization and deployment
  • Entering edit mode with hot-reload
  • Development workflow with code changes
  • Troubleshooting common issues
  • Exiting edit mode

Commands Reference

  • caproni up - Start cluster and deploy applications
  • caproni run - Run edit mode processes with hot-reload
  • caproni status - Check cluster and deployment status
  • caproni down - Stop the cluster gracefully
  • caproni update - Update repository checkouts
  • caproni update-etc-hosts - Update /etc/hosts entries

Additional Examples

More examples from other teams coming soon!

Related Documentation

  • Configuration Guide - Complete configuration reference
  • Design Documents - Architecture details
  • Command Reference - All CLI commands
  • Repository Management - How Caproni manages repositories
Last updated on November 17, 2026
FAQ & Troubleshooting
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.