Pantavisor Container Groups
In this post, we are going to talk about how to make use of the container groups feature included in the Pantavisor 019 release. Starting from the default group configuration and moving into a customized one, taking a fictitious set of network equipment devices as an example.
We are going to begin by understanding how the default groups are configured. Groups are defined as a JSON, and the default groups JSON looks like this:
[
{
"name":"data",
"description":"Containers which volumes we want to mount but not to be started",
"restart_policy": "system",
"timeout": 30,
"status_goal": "MOUNTED"
},
{
"name":"root",
"description":"Container or containers that are in charge of setting network connectivity up for the board",
"restart_policy": "system",
"timeout": 30,
"status_goal": "STARTED"
},
{
"name":"platform",
"description": "Middleware and utility containers",
"restart_policy": "system",
"timeout": 30,
"status_goal": "STARTED"
},
{
"name":"app",
"description": "Application level containers",
"restart_policy": "container",
"timeout": 30,
"status_goal": "STARTED"
}
]
As you can see, there are four default groups: data, root, platform and app. Each group can contain a description plus a default restart policy and default status goal/timeout for the containers in the group that does not have those explicitly configured.
Besides the default values for the member containers, groups will also define the start up order of the revision, as all containers from each group will not pass the BLOCKED status until each container from the previous group (if any) has reached its status goal.
This setup is good enough for our initial devices containers but what happens if we need something more complex?