Local mode

This document assumes that you have your local environment set up to run Commodore as commodore. See Running Commodore for a guide to get your local environment set up.

Commodore provides a local mode for the catalog compile command. Local mode can be enabled with the --local flag.

Local mode is intended for local development, and won’t fetch information from Lieutenant or clone Git repositories for the inventory and components. However, by default Commodore will fetch Jsonnet dependencies in local mode (using jsonnet-bundler) and will configure Kapitan to fetch dependencies. This dependency fetching can be disabled with the --no-fetch-dependencies command line flag.

commodore catalog compile <cluster-id> --local [--no-fetch-dependencies]

In local mode, the existing directory structure in the working directory is used. This allows local development on components and also allows testing local modifications to the inventory.

The user is responsible for preparing the working directory to hold a directory structure which Commodore understands. We recommend running Commodore in regular mode once to fetch all the inputs which are required to compile the catalog for the selected cluster.

commodore catalog compile <cluster-id>

Local mode will perform component discovery and will create Kapitan targets for discovered components. However, Commodore will only create targets for components which are present in dependencies/. See the how-to on adding a component to a cluster in local mode for detailed steps to add new or existing components to a cluster in local mode.