Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Creating A Working Directory

Clova’s operations heavily use the filesystem as a source of truth for your network. You can add this to version control so you can maintain a history of your network and sync your service definitions.

Initialising A Directory

Fundamentally, Clova relies upon two files: clova.toml and service.clova.toml. The first of these holds the global configuration for Clova and the second holds a service definition.

While there is no defined directory structure required for Clova, something like the following is recommended:

.
├── clova.toml
├── service1/
│   ├── service.clova.toml
│   └── (other service files)
└── service2/
    ├── service.clova.toml
    └── (other service files)

Clova can generate this basic structure for you with the following command:

clova init /path/to/directory

Relation Between Services and Directories

Every directory with a service definition file is treated as a service by Clova. You refer to services using the names of these directories.

When services are synchronised to targets, the entire contents of the service directory is copied across. That means you can choose how the service is structured and what technology to use.

As an example, the structure of a Docker Compose service might look like so:

service-dir/
├── data/
├── service.clova.toml
└── compose.yml

Clova would copy across the entire directory, including the service definition file.