Initiating a project
You can manually create the minimal required empty configuration or use the init command in some empty working directory:
The content of the overnode.yml file will be similar to the following:
version are mandatory top-level properties and explained in more details in the Configuration Reference.
This default configuration does not define any containers, but enables related container management overnode commands to work, for example:
Launching a service
Let's add an application. We will run echo server as our Hello World application.
We need to create Docker Compose file, which defines the service. Check out the referenced Compose files documentation for the details about the fields and options. As a minimal required configuration for the Echo service, we will use the following:
network_mode is set to
bridge. This is required for attaching the container to the cluster network managed by weavenet.
restart is set to
unless-stopped, making it automatically restart on a crash or host restart. This will make it running like a service but not as one-off process.
We save it to
echo/service.yml file and reference it in the overnode.yml file by adding the following section:
echois a stack name, we assigned
echo/service.ymlis a path to the Docker Compose file, we previously created
*is a placement rule, which defines the referred file should be applied to every Overnode node
You can assign any names for stacks and files as long as they contain the allowed set of characters. Docker Compose files should be placed in the same directory or it's sub-directories as the overnode.yml file.
The same project can have many stacks. A stack can refer to many different Docker Compose files. Each referenced file can have different placement rule.
Now we can bring the service up:
And see it responding on HTTP requests:
You can also see the hint in the generated overnode.yml file about adding an example service by running the init command with arguments. This feature allows reusing pre-configured, published and shared stacks without writing or copying configuration files manually.
So, you can add the same pre-configured echo server by running:
Overnode can also pull configurations from private repositories. You will need to enter username and password to authenticate the client.
If your cluster already runs a project, you can restore its configuration files to any directory by running the init command with the restore argument. It is necessary to know the project unique identifier, if the default detected project ID is not right. For example:
If you also would like to version control your configurations, you can store it in a local and/or remote git repository.
To list containers and services status, use ps command:
Updating a service
To apply any changes, update any of the configuration files and run up command again.
Destroying a service
Destroying a project
If you do not need anymore all containers, volumes and images created by a project, run down command to destroy containers and, optionally, volumes and images:
Other commands related to containers state management are: